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!

Another question about VB Scripts

Status
Not open for further replies.

jack1529

Technical User
Jun 19, 2008
7
US
I am new to VB and could use some help writing a script for net time and date settings
 
I would suggest reading through the FAQ, searching on these and other forums, and looking at the language reference on Microsoft's Technet (google "VBScript Language Reference and it should be the first result). If you have a more specific question, ask away. To get the best results, make sure you are as explicit as possible and include code snippets and any error messages you get.
 
This is the script I came up with, but when I run it nothing happens. Can someone please help.

Dim objShell, RegLoc
Set objShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next
RegLoc = "[HKEY_Current_User\Control Panel\International]"

objShell.rewrite RegLoc,"MM/dd/yyyy","REG_SZ"

WScript.Quit
 
Since it looks like tsuji already fixed your problem, I'll chime in with a little bit more advice. When you have a script that runs but doesn't seem to do anything, your first error-checking step should be to comment out the line "On Error Resume Next" so that any error messages will kill the script execution and kick back an error to the shell or a message box (depending if you are running it with wscript or cscript).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top