PDA

View Full Version : File.Run


DAK
10-02-2004, 11:25 AM
Ref: 'action run exe and argument by jenny62 9/24'

I am having the same issue.
I am trying to call sf6 uninstaller from sf7.
Example: File.Run(SessionVar.Expand("%WindowsFolder%").."\\iun6002.exe", _
SessionVar.Expand("%AppFolder%").."\\irunin.ini", "", SW_SHOWNORMAL, true); [Using or not using the Working Folder makes no difference]
The error message is "Could not load initialization file."

Calling this from the command prompt works just fine. Calling this from within VB works just fine (Shell function).

The only way I have been able to get the File.Run to work is to place 'irunin.ini' in the %WindowsFolder% and use %WindowsFolder% as the passed argument.

Any suggestion?

Dave

csd214
10-03-2004, 01:20 PM
I think you have forgotten the escape sequence in the arguments.


The backslash and quote (\") is known as an escape sequence. An escape sequence is a special sequence of characters that gets converted or “translated” into something else by the script engine. Escape sequences allow you to include things that can’t be typed directly into a string.

\" - quotation mark

If the uninstall string is:
C:\WINDOWS\iun6002.exe "D:\Program Files\TIM\irunin.ini"
the elements are:
strUninstallCmd = _WindowsFolder.."\\iun6002.exe"
strUninstallArgs = "\"D:\\Program Files\\TIM\\irunin.ini\"";

All of us has experienced that an action we have written didn't work as expected. It's then a good idea to debug with a Dialog.Message Box – or the great feature "The Debug Window" which you didn't have in SUF6.