Solved

Logon script config needed

Posted on 2009-05-19
7
374 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
ID: 24423701
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
ID: 24423840
not able to run vbscript for this; need to use .bat & kix file.
0
 
LVL 84

Expert Comment

by:oBdA
ID: 24425192
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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

Author Comment

by:Cooker4246
ID: 24425287
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 84

Accepted Solution

by:
oBdA earned 500 total points
ID: 24425376
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
ID: 24425567
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
ID: 31582999
Works great had to change one value my fault, to $error=writevalue($RegKey, "proxy_port", "00000438", "REG_SZ")
Thanks..
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Connecting two servers 30 87
Task with PowerShell Script is failing with 0x41301 7 121
server DNS address could not be found 22 256
Delete Disconnected Site from Active Directory 3 25
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

821 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