|
Answer» Hello hopers,
I'm trying to set up a batch file for LOGIN script on SBS 2003. What I really want to do is set it up so that the script will put a standard set of shortcuts onto users desktops if they dont already have them. The problem I have is that different users have several different names for their Outlook shortcut, therefore my IF NOT EXIST "%userprofile%\desktop\Microsoft Office Outlook.lnk". (copy "[location of LINK]" "%userprofile%\desktop".) code DOESNT guarantee against users getting multiple outlook shortcuts on their desktop.
Is there an OR command I can USE so that the .bat looks for several different shortcut names before creating a new one, or is there an alternative way to code the .bat for shorcuts (perhaps by target rather than file name).
Cheers guys
Ben (noob)You can piggyback commands in batch code so only one of a series of statements get executed.
Code: [Select]if condition1 do something1 & goto skip if condition2 do something2 & goto skip if condition3 do something3 & goto skip :skip
I'll LEAVE it to you to decide who gets what Outlook shortcut. 8-)I couldnt get your method to work, but I modified it a bit using the GOTO SKIP command to create:
IF EXIST "%userprofile%\desktop\Microsoft Office Outlook.lnk" GOTO SKIP IF EXIST "%userprofile%\desktop\EMAIL.lnk" GOTO SKIP etc... etc...
copy "[shortcut location]" "%userprofile%\desktop"
:SKIP
et voila, it works
Cheers for pointing me in the right direction
|