Re: possible to execute DOS commands without using "wscript.Shell"?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Torgeir Bakken \(MVP\) (Torgeir.Bakken-spam_at_hydro.com)
Date: 06/08/04


Date: Tue, 08 Jun 2004 23:44:25 +0200

sumGirl wrote:

> I cant get wscript.shell to work on any of the Win98 machines we have
> here...I know WTF with the Win98? Anyway, is there a way to execute
> DOS commands or a batch file from VBScript without resorting to
> something like
> Set WshShell = WScript.CreateObject("WScript.Shell")?
Hi

I think the Shell.Application object is available for Win98:

Set oWShellExt = CreateObject("Shell.Application")

' now call the ShellExecute method, which is member
' of the IShellDispatch2 class (this class is only
' supported in Shell32.dll Version 5.0)
'
' Interface: ShellExecute (file, arguments, dir, operation, show)
' the first parameter is mandatory
' file: the file to execute
' arguments: arguments for the executable
' dir: working directory
' operation: operation to execute
' show: view mode application window

oWShellExt.ShellExecute ...

ShellExecute Method
http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/objects/ishelldispatch2/shellexecute.asp

-- 
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx


Relevant Pages

  • Re: Script a double-click?
    ... this opens the text file in UltraEdit (that is my default ... ' now call the ShellExecute method, ... ' operation: operation to execute ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.vbscript)
  • Re: Script a double-click?
    ... this opens the text file in UltraEdit (that is my default ... ' now call the ShellExecute method, ... ' operation: operation to execute ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.wsh)
  • Re: How to change current directory?
    ... ' now call the ShellExecute method, ... ' operation: operation to execute ... To close the command prompt after launch of myprog.exe, ... torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.vbscript)
  • Re: possible to execute DOS commands without using "wscript.Shell"?
    ... It wasn't a standard part of Windows until ... >' file: the file to execute ... >ShellExecute Method ... >torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.scripting.vbscript)
  • Re: Cross Domain Scripting Vulnerability, Javascript
    ... The local computer zone in XP SP2 doesn't have permissions to execute ... >>> Microsoft Internet Explorer file:javascript: Cross Domain Scripting ... The web site has to know the exact path and name of the ...
    (microsoft.public.windows.inetexplorer.ie6.browser)