tulik23 Posted February 26, 2006 Posted February 26, 2006 HiI just posted my small script that i would like to run everything is working fine beside that i dont want that the user will see the quetion when the reg key is being installed It ask the user for his permission to add the registry key Please help It preety urgent Thanks Tzvika ***** VBS ****************Dim WshShell ' General shell objectSet WshShell = WScript.CreateObject("WScript.Shell")Const TIMEOUT = 3 ' Time out for popup windows while running logon scriptwshShell.Popup "Hello " & UserName & ", your clock is being set...", TIMEOUTWshshell.run "1.reg",0, True******** 1.Reg ***********[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Jerusalem Standard Time]"Display"="(GMT+02:00) Jerusalem""Dlt"="""TZI"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,01,00,00,00,02,00,01,00,00,\ 00,00,00,00,00,00,00,03,00,05,00,05,00,02,00,00,00,00,00,00,00
Yzöwl Posted February 26, 2006 Posted February 26, 2006 Will this doset oShell = CreateObject("WScript.Shell")oShell.run"regedit /s 1.reg"
gunsmokingman Posted February 26, 2006 Posted February 26, 2006 Or if you want to have the VBS make the reg file then run it then delete the reg fileDim Act, Fso, RegFile, Ts '''' Varibles For The Script '''' Object For The Script Set Act = CreateObject("Wscript.Shell") Set Fso = CreateObject("Scripting.FileSystemObject") RegFile = Act.ExpandEnvironmentStrings("%SystemDrive%\Set_Time.Reg") Set Ts = Fso.CreateTextFile(RegFile) Ts.WriteLine "Windows Registry Editor Version 5.00" & vbCrLf Ts.WriteLine "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Jerusalem Standard Time]" Ts.WriteLine """Display""=""(GMT+02:00) Jerusalem""" Ts.WriteLine """Dlt""=""""" Ts.WriteLine """TZI""=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,01,00,00,00,02,00,01,00,00,\" Ts.WriteLine "00,00,00,00,00,00,00,03,00,05,00,05,00,02,00,00,00,00,00,00,00" Act.Popup "Preparing To Change The Time", 3, "Time Change", 0 + 32 Act.Run("regedit /s " & RegFile),0,True If Fso.FileExists(RegFile) Then Fso.DeleteFile(RegFile) End If
Stealth111 Posted September 22, 2006 Posted September 22, 2006 Is it possible to add or modify a registry file via a vb script or batch file the would grab part of the the data using the %username% variable, I am using folder redirection in our domain, and I have a program that requires a file association of .egp , so when they click on Example.egp it will open \\SERVERNAME\Redirect\KIM HAWS\Easy Grade Pro\egp.exe, and the same for \SERVERNAME\Redirect\tim shay\Easy Grade Pro\egp.exe, ect.. in the registry under classes is the location of where i want to associate a program with the .egp file extension, but the location of the program to execute it changes with each logged in user.. The data path goes to their logged in username, so I can use the %username% variable somewhere, but the registry does not understand that.. Maybe some help on a batch file or .vbs that might grab the info from %username% and put it into the registry or just create a .reg key that I can add to the registry further down the login script after the new data has been created into the reg file.. Thanks for any help anyone can offer..
Yzöwl Posted September 22, 2006 Posted September 22, 2006 (edited) @ Stealth111What about this 'batch file' example:1: @ECHO OFF2: REG ADD HKLM\SOFTWARE\Classes\.egp /VE /D "egpfile" /F >NUL3: REG ADD HKLM\SOFTWARE\Classes\egpfile /VE /D "Easy Grade Pro File" /F >NUL4: REG ADD HKLM\SOFTWARE\Classes\egpfile\shell\open\command /VE /T REG_EXPAND_SZ /D "\"\\SERVERNAME\Redirect\%%USERNAME%%\Easy Grade Pro\egp.exe\" %%1" /F >NULPlease remove the line numbers, they are only added to identify wrapped lines. Edited September 22, 2006 by Yzöwl
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now