Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

shell will not run problem

Status
Not open for further replies.

vemate

Programmer
Aug 23, 2002
61
US
vemate (Programmer) 7 Apr 05 15:12
I can go to Start Run and Paste %SystemRoot%\system32\fpa\aas2.exe and the program will execute.
I try to use the shell I created and get this error.

activex component can't create object "wscript.shell"

<SCRIPT LANGUAGE="VBScript">
Dim wshShell
Set wshShell = CreateObject("WScript.Shell")
wshShell.Run("%SystemRoot%\system32\fpa\aas2.exe")
MsgBox "Ran FPA from System32"
</SCRIPT>

I am no expert with shells.
Thanks
 
Try this one :

Code:
WshShell.Run "%SystemRoot%\System32\fpa\aas2.exe"

Parentheis is used when you bind WshShell to an object to retrieve result from the command. If doing so, you must wait for return Ex :
Code:
strResult = WshShell.Run("%SystemRoot%\System32\fpa\aas2.exe",,True)
Wscript.echo strResult
Syntax : object.Run(strCommand, [intWindowStyle], [bWaitOnReturn])

I'm actually not sure if you can use the syntax %systemroot%, you might have to do it through "Cmd /C %Systemroot%..."

Hope this helps...
 
hmm, that's true... didn't see that :)

Code:
Set WshShell = WScript.CreateObject("WScript.Shell")
 
No, JadeKnight. That only makes thing worse.
vemate, you have to lower the security level (zone) of the ie. Or, you simply rename the .htm file to .hta.
- tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top