Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WScript.Shell
Message
 
To
27/12/2002 07:01:06
General information
Forum:
Visual C++
Category:
Other
Title:
Miscellaneous
Thread ID:
00736010
Message ID:
00736024
Views:
14
Robert,

It's not nesessary to use WScript.Shell in VC++ for this task. You can simply use WinExec API function:
WinExec("command /c ipconfig > c:\\ip.txt", SW_SHOWNORMAL);
If you really need to use Shell object, then take a look on #import directive and CComPtr class.

>Hello!
>
>Frontmatter:
>I'm a complete newbie to vc++6.
>
>
>Normally I'm programming with VFP but due to some circumstances I'm forced to write a small application in VC++6.
>My problem is that I want/must use WScript.Shell and I'm don't know how to create this object.
>
>In VFP I would say:
>
>local x
>x=createobject("wscript.shell")
>x.run("command /c ipconfig > c:\ip.txt")
>rele x
>
>
>This is a part of the code I should 'translate'.
>I've tried using MSDN but now my patience is nearly at the end.
>
>Thanks for help.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform