CODEDIGEST
Home » Articles
Search
 

Technologies
 

CodeDigest Navigation
 

Technology News
No News Feeds available at this time.
 

Community News
No News Feeds available at this time.
 
Script to Check Operating System Version and Copying Customized MSGINA.dll file

By Nirmal Sharma
Posted On Apr 01,2008
Article Rating:
Be first to rate
this article.
No of Comments: 0
Category: Directive Service
Print this article.

Script to Check Operating System Version and Copying Customized MSGINA.dll file

This script explains how you can use a small script in GPO Login Script to copy a customized MSGINA.dll for logon purpose to operating systems. Windows XP and Windows 2000 MSGINA.dll are different. Windows 2000 MSGINA.dll will not work on Windows XP and vice-versa.

 

1.      This script stores the reports in a central place (\\domain_name.com\netlogon\logon\MSGINAReport.csv. and report is saved as CSV so you can open it in Excel.

2.      MSGINA.dll file is copied as per the Operating System version. If its XP then MSGINA.dll for XP will be copied to client computer. If its Windows 2000 then MSGINA.dll for Windows 2000 will be copied to client computer.

3.      Ver.exe and hostname.exe are used to determine the Operating System version and Computer Name respectively.

 




***Start***

 

@Echo off

REM Reports will be saved in \\domain.com\netlogon\logon\MSGINAReport.csv

 

Echo Computer Name, Windows Version, Copied or Not ? >> \\domain.com\netlogon\logon\MSGINAReport.csv

 

SET Comp_name=

SET Win_Ver=

SET GinaCopied=

 

Hostname > host.txt

FOR /F "Tokens=1" %%a in (host.txt) DO Set Comp_name=%%a

 

VER > ver.txt

FOR /F "Tokens=*" %%a in (ver.txt) DO SET Win_Ver=%%a

 

Find /i "XP" < Ver.txt

if %ERRORLEVEL% == 0 (

     COPY "\\domain.com\netlogon\logon\msgina-xp.dll" "%WINDIR%\System32"

     IF %errorlevel% == 0 (

            SET GinaCopied=Yes

      ) ELSE (

            SET GinaCopied=No

      )

     CALL REGEDIT /S \\domain.com\netlogon\logon\logon-xp.REG

) ELSE (

     COPY "\\domain.com\netlogon\logon\msgina-2k.dll" "%WINDIR%\System32"

     IF %errorlevel% == 0 (

            SET GinaCopied=Yes

      ) ELSE (

            SET GinaCopied=No

      )

     CALL REGEDIT /S \\domain.com\netlogon\logon\logon-2k.REG

)

 

Echo %Comp_name%, %Win_Ver%, %GinaCopied% >> \\domain.com\netlogon\logon\MSGINAReport.csv

***End***

Similar Articles

You can contribute to CodeDiget.Com:
Donate to CodeDigest.com
Article Feedback
Comments