You are here

Run Portable App from network share on Windows 7/Vista without static network drive

1 post / 0 new
mi6
Offline
Last seen: 14 years 4 months ago
Joined: 2010-07-31 08:17
Run Portable App from network share on Windows 7/Vista without static network drive

Running a portable app from a network share (UNC, e.g. \\srv\...) and not a static mapped drive providing a drive letter (e.g. Z:\) can disable some funtionality on the app. I will explain how to solve this issue by using the example of FireFox portable.

For me, FireFox and Google Toolbar didn't work as I wanted: The search history was not saved nor was it enabled when running ff from a UNC (under Windows 7, but I guess this is valid for most Windows versions).

My UNC to ff portable would not be static and change from time to time, so mapping a static network drive wouldn't be an option. So I went ahead and made use of the PUSD/POPD commands which create an on-the-fly drive from any UNC.

The executable "STARTHELPER.CMD" file placed in the ff portable root directory on the network share looks like this:

pushd "[Directory where ff portable is located on the share]"
firefoxportable.exe
popd

where [Directory where ff portable is located on the share], in my case, is "\\VBOXSVR\Eigene.Dateien.Host\Anwendungen\Mozilla FirefoxPortable".

That worked to my satisfaction: Google Toolbar history would now be enabled and saved just as expected when running ff from a path with drive letter (e.g. z:\) which, of course, it was since PUSHD temporarily maps a drive to a UNC.

BUT: A new issue would come up. The command window would stay open as long as ff was running. I wanted a clean solution without that open command window.

My search on google ("run command without console window"), inspired by my vague knowledge of Windows' RUNDLL command, brought up an interesting solution; a VBS file with the following code:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "[filename.cmd]" & Chr(34), 0
Set WshShell = Nothing

where [filename.cmd] would be the executable STARTHELPER.CMD (see above).

I saved this as START.VBS in the same folder as the STARTHELPER.CMD and pinned it to the taskbar (Google search or look at answer from microsoft MVP or at this).