ShellExecute problem!

I have the following lines of code that just won't work for me.  It's like it's executing the correct file but the parameters are not being passed to it.  Any help is greatly appreciated!

objShell.ShellExecute("\\\\tst-app06\\McKesson\\PWHC\\Apps\\pwhc.exe", "\/si\:\\\\tst-app06\\McKesson\\PWHC\\CONFIG\\Prod01", "", "open", 1);

AND (in a different file)

objShell.ShellExecute("\\\\tst\\apps\\SCMS\\SCMSApp.mdb", "/wrkgrp \\\\tst\\apps\\SCMS\\SCMS SYSTEM Security 2003.mdw", "", "open", 1);

RobinsRLAsked:
Who is Participating?
 
ZvonkoSystems architectCommented:
Also check this version:

objShell.ShellExecute("\\\\tst\\apps\\SCMS\\SCMSApp.mdb", '/wrkgrp "\\\\tst\\apps\\SCMS\\SCMS SYSTEM Security 2003.mdw" ', "", "open", "1");


0
 
ZvonkoSystems architectCommented:
Pass the last parameter as String: "1"

0
 
ZvonkoSystems architectCommented:
Here a tested example:

<HTML>
<HEAD>

<SCRIPT type="text/javascript" LANGUAGE="JavaScript">
  function executeCommands(inputparms)
   {
    var oShell = new ActiveXObject("Shell.Application");
    var commandtoRun = "C:\\Windows\\Notepad.exe";
    if (inputparms != "")
     {
      var commandParms = document.Form1.filename.value;
     }

     oShell.ShellExecute(commandtoRun, commandParms, "", "open", "1");
  }
</SCRIPT>

</HEAD>
<BODY>
<FORM name="Form1">
<CENTER>
<BR><BR>
<H1>Execute PC Commands From HTML </H1>
<BR><BR>
<File Name to Open:> <Input type="text" size="80"
   name="filename" value="c:\windows\FaxSetup.log"/>
<BR><BR>

<input type="Button" name="Button1"
   value="Run Notepad.exe" onClick="executeCommands()" />

<BR><BR>
</CENTER>
</BODY>
</FORM>
</HTML>

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
RobinsRLAuthor Commented:
Nope, that didn't work either.
0
 
RobinsRLAuthor Commented:
I've seen that working solution, however, it doesn't help me fix my problem.  The first parameter set is as follows (before jscript adaptation):

/si:\\tst-app06\McKesson\PWHC\CONFIG\Prod01

I could have simply formatted incorrectly.  The second one is as follows:

/wrkgrp \\tst\apps\SCMS\SCMS SYSTEM Security 2003.mdw


Thanks...
0
 
ZvonkoSystems architectCommented:
Are you sure that those parameters are formated like that? Put them in String vars and alert() them out before passing to the calls.

Also be sure that those files shares are accessible. Test the paths in File Explorer.
0
 
RobinsRLAuthor Commented:
I'm positive the parameters are formatted like that.  I took them directly from the working shortcuts.  And your suggestion still doesn't work. =(
0
 
ZvonkoSystems architectCommented:
Common, what on my suggestion does not work? My suggestion is tested, Your environment is messy.
Copy that exe and needed directories local on disk and check to execute the programs in a bat file.
If that bat file works, and only after that, search your syntax problems in the html page.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.