Solved

Logon script config needed

Posted on 2009-05-19
7
370 Views
Last Modified: 2012-05-07
Need to configure logon script .bat & kix file to run the following on logon without prompting user. i need to configure this for two different types of scripts.

$error=addkey("HKEY_CURRENT_USER\Software\Google\Google Talk\Options")
$error=writevalue("HKEY_CURRENT_USER\Software\Google\Google Talk\Options"), "autodetect_proxy", "00000000", "REG_DWORD")
$error=writevalue("HKEY_CURRENT_USER\Software\Google\Google Talk\Options"), "proxy_host", "10.128.47.132", "REG_SZ")
$error=writevalue("HKEY_CURRENT_USER\Software\Google\Google Talk\Options"), "proxy_port", "1080", "REG_SZ")
$error=writevalue("HKEY_CURRENT_USER\Software\Google\Google Talk\Options"), "autostart", "00000000", "REG_DWORD")

..................

set regkey="[HKEY_CURRENT_USER\Software\Google\Google Talk\Options]"

%Systemroot%\system32\reg.exe add %regkey% /v "autodetect_proxy" /t reg_dword /d 0x0 /f
%Systemroot%\system32\reg.exe add %regkey% /v "proxy_host" /t reg_sz /d 10.128.47.132 /f
%Systemroot%\system32\reg.exe add %regkey% /v "proxy_port" /t reg_sz /d 1080 /f
%Systemroot%\system32\reg.exe add %regkey% /v "autostart" /t reg_dword /d 0x0 /f
0
Comment
Question by:Cooker4246
7 Comments
 
LVL 17

Expert Comment

by:Jared Luker
Comment Utility
This can be done very easily via VBScript.. See attached.
Set WshShell = WScript.CreateObject("WScript.Shell")

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set WshNetwork = WScript.CreateObject("WScript.Network")	'Network Object
 

WshShell.RegWrite "HKCU\Software\Google\Google Talk\Options\autodetect_proxy",0,"REG_DWORD"

WshShell.RegWrite "HKCU\Software\Google\Google Talk\Options\proxy_host","10.128.47.132","REG_SZ"

WshShell.RegWrite "HKCU\Software\Google\Google Talk\Options\proxy_port","1080","REG_SZ"

WshShell.RegWrite "HKCU\Software\Google\Google Talk\Options\autostart",0,"REG_DWORD"

Open in new window

0
 

Author Comment

by:Cooker4246
Comment Utility
not able to run vbscript for this; need to use .bat & kix file.
0
 
LVL 82

Expert Comment

by:oBdA
Comment Utility
Well - what exactly do you still need to configure? Neither of the above scripts should ask for user input, and only the registry key in the batch script needs some correction; the brackets aren't necessary:
set regkey="HKEY_CURRENT_USER\Software\Google\Google Talk\Options"
0
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 

Author Comment

by:Cooker4246
Comment Utility
This script does not work, via kix file am i missimg something?

$error=addkey("HKEY_CURRENT_USER\Software\Google\Google Talk\Options")
$error=writevalue("HKEY_CURRENT_USER\Software\Google\Google Talk\Options"), "autodetect_proxy", "00000000", "REG_DWORD")
$error=writevalue("HKEY_CURRENT_USER\Software\Google\Google Talk\Options"), "proxy_host", "10.128.47.132", "REG_SZ")
$error=writevalue("HKEY_CURRENT_USER\Software\Google\Google Talk\Options"), "proxy_port", "1080", "REG_SZ")
$error=writevalue("HKEY_CURRENT_USER\Software\Google\Google Talk\Options"), "autostart", "00000000", "REG_DWORD")


you can disregard this script
set regkey="[HKEY_CURRENT_USER\Software\Google\Google Talk\Options]"
%Systemroot%\system32\reg.exe add %regkey% /v "autodetect_proxy" /t reg_dword /d 0x0 /f
%Systemroot%\system32\reg.exe add %regkey% /v "proxy_host" /t reg_sz /d 10.128.47.132 /f
%Systemroot%\system32\reg.exe add %regkey% /v "proxy_port" /t reg_sz /d 1080 /f
%Systemroot%\system32\reg.exe add %regkey% /v "autostart" /t reg_dword /d 0x0 /f


0
 
LVL 82

Accepted Solution

by:
oBdA earned 500 total points
Comment Utility
Sorry, missed this, but it's hard to see: you have a closing bracket directly after the registry key.
The addkey is unnecessary, btw.; writevalue will create the key if it doesn't exist.
$RegKey="HKEY_CURRENT_USER\Software\Google\Google Talk\Options"

$error=writevalue($RegKey, "autodetect_proxy", "00000000", "REG_DWORD")

$error=writevalue($RegKey, "proxy_host", "10.128.47.132", "REG_SZ")

$error=writevalue($RegKey, "proxy_port", "1080", "REG_SZ")

$error=writevalue($RegKey, "autostart", "00000000", "REG_DWORD")

Open in new window

0
 
LVL 7

Expert Comment

by:sfarazmand
Comment Utility
Something you can also do is to edit the registry making it what you want, export the key. The use reg2adm http://www.novell.com/coolsolutions/tools/13885.html to create an ADM template. Toss that into your GPO and you're set.
0
 

Author Closing Comment

by:Cooker4246
Comment Utility
Works great had to change one value my fault, to $error=writevalue($RegKey, "proxy_port", "00000438", "REG_SZ")
Thanks..
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now