是否有人有腳本可以在同一腳本中確定Windows操作系統和Office版本。VBS或Bat - 確定操作系統和Office版本
我有位和腳本的作品,但我似乎無法弄清楚如何將兩個操作系統和Office版本中的腳本。我從蝙蝠開始,現在我轉向VBS,因爲它似乎能夠提供更多的細節,但如果有人能夠在下面提供邏輯幫助,我可能會前進。
我想知道我可以設置這樣的腳本。
If Windows 7 64bit & Office 2010
do this
If Windows XP 32bit & Office 2007
do this
If Windows 7 & Office 2007
do this
CODE用於檢測Windows版本 - BAT SCRIPT
Echo Please wait.... detecting Windows OS version...
ver | find "2003" > nul
if %ERRORLEVEL% == 0 goto done
ver | find "XP" > nul
if %ERRORLEVEL% == 0 goto ver_xp
ver | find "2000" > nul
if %ERRORLEVEL% == 0 goto done
ver | find "NT" > nul
if %ERRORLEVEL% == 0 goto done
if not exist %SystemRoot%\system32\systeminfo.exe goto warnthenexit
systeminfo | find "OS Name" > %TEMP%\osname.txt
FOR /F "usebackq delims=: tokens=2" %%i IN (%TEMP%\osname.txt) DO set vers=%%i
echo %vers% | find "Windows 7" > nul
if %ERRORLEVEL% == 0 goto ver_7
echo %vers% | find "Windows Server 2008" > nul
if %ERRORLEVEL% == 0 goto done
echo %vers% | find "Windows Vista" > nul
if %ERRORLEVEL% == 0 goto ver_7
goto warnthenexit
對於OS:http://stackoverflow.com/questions/4317794/a-vbscript-to-find-windows-version-name-and-the-service-包 –