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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie Help!! Exporting

Status
Not open for further replies.

pbanacos

IS-IT--Management
Apr 21, 2006
34
US
Hello,

trying to export the registry key below to a text file. The test file does not work. I would appreciate any help!

Thank You,

Paul

var regkey;
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.Run("regedit /e c:\test.txt HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB");

 
First, change this:
Code:
var WshShell = WScript.CreateObject("WScript.Shell");
To this:
Code:
var WshShell = new ActiveXObject("WScript.Shell");

That does not solve the whole issue but at least it get's to the point of executing the shell.
I suspect the rest of the issue is related to the path you are passing and optional parameters. You may have to reverse or escape the slashes.


At my age I still learn something new every day, but I forget two others.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top