I am trying to create a batch file with the IF / ELSE command.
ie: I want it to look for a file on c:\test.txt <b>but</b> if the file already exist, I dont want to perform the action of copying the test.txt file from a remote location to c:\
This is the actual steps I am trying:
REM *** DELETING LINKS FROM START MENU ****
IF EXIST "C:\Documents and Settings\All Users\Start Menu\Add A Printer.url" DEL "C:\Documents and Settings\All Users\Start Menu\Add A Printer.url"
IF EXIST "C:\Documents and Settings\All Users\Start Menu\IT Home Page.url" DEL "C:\Documents and Settings\All Users\Start Menu\IT Home Page.url"
IF EXIST "C:\Documents and Settings\All Users\Start Menu\Open A Ticket.url" DEL "C:\Documents and Settings\All Users\Start Menu\Open A Ticket.url"
REM *** CREATE 'IT LINKS' FOLDER ****
IF EXIST "C:\Documents and Settings\All Users\Start Menu\IT Links" ELSE EXIT my prob is here, if that folder 'IT LINKS' exist then do not continue the batch, just exit OR do the following 2 lines of creating the folder and copying the links inside the folder.
md "C:\Documents and Settings\All Users\Start Menu\IT Links"
copy "\\bamdc001\sysvol\BAGLOBAL.NET\IT Links\*.*" "C:\Documents and Settings\All Users\Start Menu\IT Links\*.*"
thanks for the help
ceez
This post has been edited by ceez: 25 February 2006 - 12:43 PM



Help

Back to top










