Re: Error message: "Unable to create object named WScript.Shell"

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Change;

Set WshShell = WScript.CreateObject("WScript.Shell")
to
Set WshShell = CreateObject("WScript.Shell")

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"John" wrote:
| Hello:
|
| I use following function to execute any non-interactive commands thru VB
| Script in all my scripts.
|
| Function FUN_RunCmd(s_CmdFileName)
| Dim WshShell
| Set WshShell = WScript.CreateObject("WScript.Shell")
| WshShell.Run s_CmdFileName, 1, vbTrue
| End Function
|
| This function is working great in all my scripts without any issue. Over
| the weekend, my machine at the office was "refreshed" to newer machine.
| Now, when I run any script which uses FUN_RunCmd function, I am getting
| "Unable to create object named WScript.Shell" error message in
CreateObject
| line. I searched thru Google, but I am unable to determine what is
causing
| this error. Any assistance you could provide or put me in right direction
| to resolve this issue will be highly appreciated.
|
| Thank you in advance for the help.
|
| John
|
|


.



Relevant Pages

  • Re: vbscript runonce key
    ... runonce key again to run the batch file and reboot the script runs all the ... Instead of invoking the script directly, ... Dim objComputer, strModel, strMfg, WshShell, oExec, strCommand ... Set WshShell = CreateObject ...
    (microsoft.public.scripting.vbscript)
  • Re: vbscript runonce key
    ... Instead of invoking the script directly, ... Dim objComputer, strModel, strMfg, WshShell, oExec, strCommand ... Elseif strModel = "OptiPlex 745" Then ... Set WshShell = CreateObject ...
    (microsoft.public.scripting.vbscript)
  • Re: regedit quickie
    ... Set WSHShell = WScript.CreateObject ... 'End Script ... Doug Knox, MS-MVP Windows XP/9x ... > Tried your script but gets the message:> Invalid root in registry key. ...
    (microsoft.public.windowsxp.security_admin)
  • VBScript error on XP Embedded
    ... I'm fairly new to XP Embedded so excuse my stupidity. ... Dim isRunning ... Set wshShell = WScript.CreateObject ...
    (microsoft.public.windowsxp.embedded)
  • Re: Run Executable
    ... My problem is that I can physically get to the location from the login ... physically perform the execution on the file. ... script. ... Set WSHShell = WScript.CreateObject ...
    (microsoft.public.scripting.wsh)