IExpress passing parameters to AppLaunched

Is there a way to pass the filename (or just the path) of the exe to the bat file being launched in an exe created with IExpress?  I am trying to have the batch file check where the exe was run from.  If i pass %CD% as parameter to the bat file, it passes the path of the temp directory created by the exe, not the path the exe was run from.

Thanks in advance!

November 18th, 2012 3:43pm

These are not scripts but are directive files.  YOu need to post this question oin the platform forum for the OS you are running.

Here are the docs for IExpress:  http://technet.microsoft.com/en-us/library/dd346760.aspx

Note that the 'batch' files referred to are not commandline batch files but are IEXpress batch directive files which are a relative of the Setup 'inf' files.

Here are all of the iexpress batch mode switches: http://technet.microsoft.com/en-us/library/dd346761.aspx

Post further questions in the platform forum or in the IE forum for your version of IE.

Free Windows Admin Tool Kit Click here and download it now
November 18th, 2012 5:13pm

Assun=ming you are usign this to create a wrapper for a script fiel.

Launch batch file is test.cmd

script file is test.vbs

the batch file would contain a line like:

cscript test.vbs myargument1 myargument2

November 18th, 2012 5:42pm

I am using IExpress as a wrapper for a script file.  I have no problem passing arguments from the bat file to the vbs file.  Where I am having a problem is determining the path of the exe (created with IExpress) that calls the bat file.  Right now, the AppLaunched command for the exe is:

cmd /c TestName.bat %CD%

 However, %CD% returns the temp folder that the exe created, not the path that the exe was run from.  I also tried %0, but the exe doesn't recognize it as anything other than text.

cmd /c TestName.bat %0


TestName.bat is (extra parameters included so I don't need to keep modifying it as I try new things):

testname.vbs %0 %1 %2 %3


Testname.vbs is:

Set args = Wscript.Arguments
msgbox args.count
For Each arg In args
  msgbox arg
Next



Free Windows Admin Tool Kit Click here and download it now
November 18th, 2012 6:02pm

That is correct.

This is not an exe it is an installer.  It is used fro installing custom versions of IE.  It has been co-opted to create an exe wrapper for a script.  It cannot do what you are trying to do.

The installer technology does not allow the installed program know where the installer was launched from. 

If you want an EXE wrpper that works as such you willneed to purchase one of the many script editors that include exe converters.

November 18th, 2012 6:16pm

I had a  feeling that was going to be the answer, but figured I would ask.  Thanks.
Free Windows Admin Tool Kit Click here and download it now
November 18th, 2012 7:23pm

Actually, it can be done

Syntax within IEXPRESS

Install Program:  wscript.exe <yourvbs.vbs> ""#e""

#e is the EXE path name, a predefined/internal variable

In your VBSCRIPT, you then simply need to look at the arguments.  To be safe, I enumerate them

For each arg in wscript.arguments
  AppPath = AppPath & " " & lcase(arg)
Next


May 29th, 2015 8:21pm

Actually, it can be done

Syntax within IEXPRESS

Install Program:  wscript.exe <yourvbs.vbs> ""#e""

#e is the EXE path name, a predefined/internal variable

In your VBSCRIPT, you then simply need to look at the arguments.  To be safe, I enumerate them

For each arg in wscript.arguments
  AppPath = AppPath & " " & lcase(arg)
Next


Free Windows Admin Tool Kit Click here and download it now
May 30th, 2015 12:18am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics