Page 1 of 1 breaks when converted to .exe

Posted: Thu Nov 19, 2009 6:02 am
by kenthompson
I have an hta I am attempting to convert to an exe with htaedit. Everything works fine, ( on an hta runs ok) except I have a command to run a vbs file.
The exe seems to just unload the file structure into a temp file and everything that gets called is in the original folder hierarchy within the temp file.

Here is my run:
strCmdLine = strCurrentDirectory&"ReqLoader.vbs" strCmdLine = Chr(34)&strCmdLine&Chr(34)strCmdLine = strCmdLine& " " & Chr(34)&strPassFolder&Chr(34)strCmdLine = strCmdLine& " " & Chr(34)&strRelFolderName&Chr(34)strCmdLine = strCmdLine& " " & Chr(34)&strPassRelease&Chr(34)strCmdLine = strCmdLine& " " & Chr(34)&strPassProject&Chr(34)strCmdLine = strCmdLine& " " & Chr(34)&strPassDoc&Chr(34)strCmdLine = strCmdLine& " " & Chr(34)&strPassPlatform&Chr(34)strCmdLine = strCmdLine& " " & Chr(34)&strPassCycles&Chr(34)strCmdLine = strCmdLine& " " & Chr(34)&strPassModules&Chr(34)strCmdLine = strCmdLine& " " & Chr(34)&strUserName&Chr(34)strCmdLine = strCmdLine& " " & Chr(34)&strPassword&Chr(34)strCmdLine = strCmdLine& " " & Chr(34)&strPassProductlist&Chr(34)strCmdLine = strCmdLine& " " & Chr(34)&strDomain&Chr(34)strCmdLine = strCmdLine& " " & Chr(34)&strProject&Chr(34)

WshShell.Run (strCmdLine)

that works fine when using it as a straight hta, but when put in the exe it comes back with:
"The system cannot find the file specified"

I tried to play with the commas and such, I even took out all the parms I'm passing so it is just the straight file name. The file name looks good in the debugger locals, I can follow the path straight to the vbs doc, but the system can't find it.

any ideas on this?
any help will be appreciated. breaks when converted to .exe

Posted: Thu Nov 19, 2009 6:34 am
by kenthompson
I figured out the problem. The run line should have looked like this

WshShell.Run strCmdLine,1,false

I didn't have the switches before. I don't know why it worked as an hta without the switches, but it did. and now it works as an exe with the switches in there....

mysterious to me, but I'm sure there is an answer as to why.