Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 370
  • Last Modified:

Putting a shortcut onto the Desktop via a batch file

I have an Access application that is installed using the SageKey software app.  However, the front-end that everyone uses (as a loader) resides on a server.  This causes me a problem with the shortcut, since the software does not appear to allow you to point to the front-end on a server (it's fine if the front-end is on the local drive).

I have tried several ways to resolve this and the closest that I have come is through a batch file (code below).  I have created numerous shortcuts that work for each drive letter and for 32 or 64bit versions of Windows.  My batch file (in theory) will look for the front-end, if found it should determine if it is 32 or 64bit and then copy one of the the template shortcuts that I have created, to the users desktop.  I have given these stored shortcuts a .tmp extension.

However, on some installations it seems to work fine - but not on others.  I am extremely rusty on batch files and was hoping someone could help.
@ECHO OFF
if EXIST "C:\Users\Public\Desktop\" if EXIST "G:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Gx86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "G:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Gx64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "H:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Hx86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "H:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Hx64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "I:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Ix86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "I:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Ix64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "J:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Jx86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "J:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Jx64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "K:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Kx86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "K:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Kx64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "L:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Lx86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "L:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Lx64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "M:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Mx86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "M:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Mx64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "N:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Nx86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "N:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Nx64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "O:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Ox86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "O:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Ox64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "P:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Px86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "P:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Px64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "Q:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Qx86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "Q:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Qx64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "R:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Rx86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "R:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Rx64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "S:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Sx86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "S:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Sx64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "T:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Tx86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "T:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Tx64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "U:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Ux86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "U:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Ux64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "V:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Vx86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "V:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Vx64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "W:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Wx86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "W:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Wx64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "X:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Xx86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "X:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Xx64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "Y:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Yx86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "Y:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Yx64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "Z:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Zx86.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"
if EXIST "C:\Users\Public\Desktop\" if EXIST "Z:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Zx64.tmp"  "c:\users\%username%\Desktop\TeleStudio.lnk"


if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "G:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Gx86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "G:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Gx64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "H:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Hx86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "H:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Hx64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "I:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Ix86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "I:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Ix64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "J:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Jx86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "J:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Jx64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "K:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Kx86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "K:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Kx64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "L:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Lx86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "L:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Lx64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "M:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Mx86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "M:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Mx64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "N:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Nx86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "N:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Nx64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "O:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Ox86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "O:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Ox64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "P:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Px86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "P:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Px64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "Q:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Qx86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "Q:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Qx64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "R:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Rx86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "R:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Rx64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "S:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Sx86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "S:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Sx64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "T:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Tx86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "T:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Tx64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "U:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Ux86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "U:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Ux64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "V:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Vx86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "V:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Vx64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "W:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Wx86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "W:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Wx64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "X:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Xx86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "X:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Xx64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "Y:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Yx86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "Y:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Yx64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "Z:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x86  copy "C:\ProgramData\CLTD\TS\Shortcuts\Zx86.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"
if EXIST "C:\Documents and settings\All Users\Desktop\" if EXIST "Z:\TS\Data Access\TS\TS.mdb" IF %PROCESSOR_ARCHITECTURE%==x64  copy "C:\ProgramData\CLTD\TS\Shortcuts\Zx64.tmp"  "C:\Documents and settings\All Users\Desktop\TeleStudio.lnk"

Open in new window

Create-Shortcut.txt
0
Andy Brown
Asked:
Andy Brown
  • 2
1 Solution
 
oBdACommented:
On XP, this will only work if the user is a local administrator, because you're copying to the "All Users" desktop instead of the user's own desktop folder.
Anyway, try this instead:
@ECHO OFF
for %%a in (G H I J K L M N O P Q R S T U V W X Y Z) do (
  if exist "%%a:\TS\Data Access\TS\TS.mdb" (
    copy "C:\ProgramData\CLTD\TS\Shortcuts\%%a%PROCESSOR_ARCHITECTURE%.tmp"  "%UserProfile%\Desktop\TeleStudio.lnk"
  )
)

Open in new window

0
 
Andy BrownAuthor Commented:
That's much nicer, i'll give it a try - Thank you.
0
 
deroodeCommented:
When driveletters can be different, why use a driveletter?

Could you not just create two %Processor-architecture%.lnk shortcuts that point to a \\server\share\app\executable.exe ?
0
 
Andy BrownAuthor Commented:
Really sorry for the delay in getting back to you - that put me on the right lines.

All the best.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now