Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wscript objects
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00143154
Message ID:
00143508
Views:
36
>>On my machine at home running Win98, the following two lines of code open up a WshNetwork object and a WshShell object respectively:
>>
>>oWshNet = CREATEOBJ('Wscript.network')
>>
>>oWshShell = CREATEOBJ('Wscript.shell')
>>
>>>
dim argv, CRLF, dsObj, dsRoot, rc, usrObj, wshShell, xlFile, xlObj
>>>CRLF = Chr(13) & Chr(10)
>>>dsRoot = "WinNT://LAB"
>>>
>>>set wshShell = Wscript.CreateObject("Wscript.Shell")
>>>set rc = wshShell.Popup("This sample script add users to a NT 4.0 SAM DB." & _
>>>                     CRLF & "Continue?", _
>>>                    60, _
>>>                    "WSH Sample", _
>>>                    vbYesNo + vbQuestion)
>>>If rc <> vbYes Then
>>>   Wscript.Quit(1)
>>>End If
>>>
>>>set argv = Wscript.Arguments
>>>
>
>Ok, so let's see how you execute the line above, argv = Wscript.Arguments. I don't think you can because you can't get to the wscript object. The wscript and network objects are no problem.

The WshArguments object is owned by a running instance of WSCRIPT.EXE or CSCRIPT.EXE; it is not a creatable, and doesn't have a ProgID. It exposes the command line of a running WSCRIPT invocation, and is accessible inside a script, not outside from what I read in the docs.

It's behavior follows that of the other Wscript properties like Wscript.ScriptName and the method Wscript.Echo
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform