Batch Files - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Software > Microsoft Windows and Software
Click Here to Login
Closed Thread
 
Thread Tools Display Modes
 
Old 03-20-2006, 01:14 PM   #1 (permalink)
Newb Techie
 
Join Date: Oct 2004
Posts: 25
Default Batch Files

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 is offline  
Old 03-20-2006, 01:52 PM   #2 (permalink)
It's all just 1s and 0s
 
office politics's Avatar
 
Join Date: Jan 2004
Location: in the lab
Posts: 6,555
Send a message via MSN to office politics
Default Re: Batch Files

Quote:
Originally posted by techdude25
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
office politics is offline  
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 05:43 AM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.