batch file and windows version
We have windows 2003 server and all clients are using XP computers with office 2003. Now we have added 2 windows 7 computers with office 2010. For the XP/2003 users we have a script that creates their outlook profile automatically once they log in (richprofile).
This script dose not work with windows7/2010. I need to check if the OS windows 7, then not execute the richprofile command and if it is windows XP, then excute it. Can someone help? here is the BAT file
@echo off\\myserver\ClientApps\RichProfile.exe exchangeserver %UserName% outlook N Dstart dc.vbsexit
So if windows 7 it should be
@echo offstart dc.vbsexit
and if windows xp, it should be
@echo off\\myserver\ClientApps\RichProfile.exe exchangeserver %UserName% outlook N Dstart dc.vbsexit
Thanks
March 29th, 2011 12:17pm
I think it will be better to post in "The Official Scripting guys Forum!":
http://social.technet.microsoft.com/Forums/en-US/ITCG/threads
This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.
Microsoft
Student Partner
Microsoft Certified Professional
Microsoft Certified Systems Administrator: Security
Microsoft Certified Systems Engineer: Security
Microsoft Certified Technology Specialist: Windows Server 2008 Active Directory, Configuration
Microsoft Certified Technology Specialist: Windows Server 2008 Network Infrastructure, Configuration
Free Windows Admin Tool Kit Click here and download it now
March 29th, 2011 12:22pm
Here you go…
@echo off
ver | find "6.1" > nul
if %ERRORLEVEL% == 0 goto Win7
ver | find "5.1" > nul
if %ERRORLEVEL% == 0 goto WinXP
:Win7
echo Running Windows 7 Script
goto exit
:WinXP
echo Running Windows XP Script
goto exit
:exit
You can even use
systeminfo | find "OS Name" command filter to find the correct version of the OS.
Santhosh Sivarajan | MCTS, MCSE (W2K3/W2K/NT4), MCSA (W2K3/W2K/MSG), CCNA, Network+ Houston, TX
Blogs - http://blogs.sivarajan.com/
Articles - http://www.sivarajan.com/publications.html
Twitter: @santhosh_sivara - http://twitter.com/santhosh_sivara
This posting is provided AS IS with no warranties, and confers no rights.
March 29th, 2011 9:42pm
Here is correct filter for Systeminfo
systeminfo | find "Windows XP"
if %ERRORLEVEL% == 0 goto WinXP
systeminfo | find "Windows 7”
if %ERRORLEVEL% == 0 goto Win7
Santhosh Sivarajan | MCTS, MCSE (W2K3/W2K/NT4), MCSA (W2K3/W2K/MSG), CCNA, Network+ Houston, TX
Blogs - http://blogs.sivarajan.com/
Articles - http://www.sivarajan.com/publications.html
Twitter: @santhosh_sivara - http://twitter.com/santhosh_sivara
This posting is provided AS IS with no warranties, and confers no rights.
Free Windows Admin Tool Kit Click here and download it now
March 29th, 2011 10:51pm
Thanks...(-:
March 31st, 2011 11:12am
You are welcome!Santhosh Sivarajan | MCTS, MCSE (W2K3/W2K/NT4), MCSA (W2K3/W2K/MSG), CCNA, Network+ Houston, TX
Blogs - http://blogs.sivarajan.com/
Articles - http://www.sivarajan.com/publications.html
Twitter: @santhosh_sivara - http://twitter.com/santhosh_sivara
This posting is provided AS IS with no warranties, and confers no rights.
Free Windows Admin Tool Kit Click here and download it now
March 31st, 2011 11:18am


