Batch Files

Status
Not open for further replies.

techdude25

Baseband Member
Messages
25
I needs some help writing an If/Then Statement in a Batch File.

I have users using Office 2000 or Office 2003. They would like Word, Excel, and Power Point Icons on the desktop. I have used the xcopy command to copy the 2003 icons to the screen.

Example:
xcopy "C:\Program Files\Microsoft Office\OFFICE11\excel.exe" "C:\Documents and Settings\%username%\Desktop\" /i /y

I could do the same code for 2000, replacing Office11 with Office10. But if the user has both installed, they will get the icon for both on the desktop.

I need a statement that says if Office11 is installed use it, if not, then use office10. Any help is appritiated
 
techdude25 said:
Example:
xcopy "C:\Program Files\Microsoft Office\OFFICE11\excel.exe" "C:\Documents and Settings\%username%\Desktop\" /i /y


this doesnt copy a shortcut. it copies the executable.


here's some other checking batch file code you can refine. use \nul to test for a directory

Code:
if exist c:\docume~1\nul goto nt

echo running for 98...
del "c:\windows\start menu\winzip.lnk"
del "c:\windows\desktop\winzip.lnk"
goto end

:nt
echo running for nt...
del "%userprofile%\start menu\winzip.lnk"
del "%userprofile%\desktop\winzip.lnk"

:end
 
Status
Not open for further replies.
Back
Top Bottom