Batch Files - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Software > Microsoft Windows and Software
Closed Thread
Thread Tools Display Modes
Old 03-20-2006, 12: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.

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, 12: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

Originally posted by techdude25
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

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

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

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

Our Communities

Our communities encompass many different hobbies and interests, but each one is built on friendly, intelligent membership.

» More about our Communities

Automotive Communities

Our Automotive communities encompass many different makes and models. From U.S. domestics to European Saloons.

» More about our Automotive Communities

Marine Communities

Our Marine websites focus on Cruising and Sailing Vessels, including forums and the largest cruising Wiki project on the web today.

» More about our Marine Communities

Copyright 2002-2015 Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 12:10 AM.

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