0

I'm trying to keep my scripts and user startups in two different folders, (the ultimate aim to hide the main program scripts)

So I have put the batch files in the script folder, created shortcuts, and placed those in "RunMe"

That works except for one proviso. The "Target" and "Start In" fields both show the drive letter AS RELATING TO MY MACHINE. When I copy folders to a USB Stick, (which is "R:" on my machine) I'm fairly certain the path will not update. More to the point, when I give USB to another end user, the drive letter in shortcut will be hopelessly wrong?

A couple of weeks ago, someone provided a 'drive independent' batch script (%~d0\foldername) ... but as far as I can tell, you can't add an icon to a batch file directly, only to a shortcut. (I want to keep the icons with my 'branding' if poss)

Anyone any workarounds?

1 Answers1

0

If you want to be able to keep the functionality of a shortcut but also keep the paths portable, you can just make the shortcut links themselves relative, such as using the method described here:

%windir%\explorer.exe "..\my\files"

Of course, the drawback of this method is that you can't use the same hack to give a relative path to the icon file, so it has to be an icon that's available on the user's computer.


Edit: Instead of calling the desired program directly with explorer.exe, you can call a custom Powershell launch script that launches, repositions, and otherwise manages your programs. That way, you can use a method such as the one shown here to reposition your window.