JSI Tip 2793. How can I tell if a Windows NT/2000 installation was an upgrade or clean install?
Jerold Schulman
September 4, 2000
1 Min Read
When Windows NT or Windows 2000 is installed, %SystemRoot%System32$winnt%.inf is created. If you inspect the [data] section, using notepad, you can determine how the operating system was installed. Here is a sample $winnt$.inf file:
[setupparams]skipmissingfiles = "0"[data]unattendedinstall = "no"floppylessbootpath = "no"producttype = "winnt"standardserverupgrade = "no"winntupgrade = "no"win9xupgrade = "no"win31upgrade = "no"sourcepath = "devicecdrom0"floppyless = "0"msdosinitiated = "0"dospath=D:
If all the parameters than end in upgrade are "no", the OS was a clean installation on a partion that had no existing operating system.
NOTE: If you subsequently perform an update install, winntupgrade may toggle to "yes".
Here is a sample Windows 2000 script, that uses NETDOM from the Support Tools, to query all member workstations.
The report is displayed on the console and written to %tmp%upgrade.txt.
@echo offsetlocalfor /f "Tokens=*" %%i in ('date /t') do set dte=%%ifor /f "Tokens=*" %%i in ('time /t') do set tme=%%i@echo %dte% %tme% @echo %dte% %tme% >%tmp%upgrade.txtfor /f "Skip=1 Tokens=1,2" %%i in ('netdom query workstation') do call :mbr %%i %%jendlocalgoto end:mbrif "%1"
"The" goto done1:mbr1set cname=%1if not exist \%cname%c$winntsystem32$winnt$.inf goto endset dp=Nfor /f "Skip=3 Tokens=*" %%i in (\%cname%c$winntsystem32$winnt$.inf) do call :parse "%%i"goto end:done1if "%2"
"command" goto endgoto mbr1:parseif "%dp%"
"Y" goto endset string=%1set string=%string:"=%set wrk=%string:upgrade=%if "%string%"
"%wrk%" goto endset wrk=%string:dospath=%if not "%string%"=="%wrk%" set dp=Y&goto end@echo %cname% %string% @echo %cname% %string% >>%tmp%upgrade.txt:end
About the Author
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
You May Also Like