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

Registry Question

Status
Not open for further replies.

Netman06

Technical User
Aug 15, 2006
70
US
Hello,

I have this small vbs script that I wanted to know, if there is a way that I can not have the information box popup.

Saying"Are you sure you want to add the information in I:\portable\lanview\lanview.reg to the registry?

Yes or No

I would like to have it overwrite, so I added to my code

, overrite = TRUE

Dim WSHShell ' declare the object variable

Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.Run "%comspec% /c " & strPath & "lanview.reg",overwrite = True

But it still asks, so what I'm I doing wrong. Any Ideas.

Thanks,

Mike
 
What about this ?
WSHShell.Run "regedit /s " & strPath & "lanview.reg"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
call regedit.exe explicitly with a /s switch to import the reg file silently. (I think it is /s. Might be /q. Haven't done it i n a while.)

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Yes, that did it. I used PHV's idea and it worked.

EBGreen, it is /s

Thanks,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top