Run an exe with parameters (ActiveX)

March 18, 2011 at 12:30:46
Specs: Windows XP, AMD Athlon 5400+ // 3GB RAM
Hi again! I have this ActiveX control that runs an exe:

<object id="mini" width=1 height=1 classid="CLSID:42F2D240-B23C-11d6-8C73-70A05DC10000" codebase= "c:/windows/notepad.exe"</object>

But is it possible to run notepad with paramaters? For example:
c:/windows/notepad.exe c:/Program Files/file.txt

<object id="mini" width=1 height=1 classid="CLSID:42F2D240-B23C-11d6-8C73-70A05DC10000" codebase= "c:/windows/notepad.exe c:/Program Files/file.txt"</object>
(to open the text file file.txt located in program files).

The code above doesn't work.


See More: Run an exe with parameters (ActiveX)

Report •


#1
March 19, 2011 at 15:37:26
Since Program Files\File.txt has embedded blanks it must be enclosed by double quotes ("), but that may conflict with object declaration. So you may use the legacy 8.3 format i.e.

"C:\Windows\notepad.exe C:\Progra~1\ File.txt"

To get the 8.3 format use dir /X.

Report •

#2
March 19, 2011 at 16:58:55
Thanks for your reply.

The blanks in the path are not the problem. If I put anything else in the codebase field, it stops working. There has to be a field like param= for example that will specify the parameters for running (I tried something with the param tag but no luck).


Report •

#3
March 20, 2011 at 07:49:03
Dld you try to code as codebase just the file you want to open ln NotePad?

"C:\Progra~1\ File.txt"

That should directly open the file in NotePad since .txt is associated to that application by default.

Report •

Related Solutions

#4
March 20, 2011 at 08:37:17
Yes but it only opens .exe files.

Report •

#5
March 25, 2011 at 10:26:54
Anyone knows?

Report •


Ask Question