Solved

Logon script config needed

Posted on 2009-05-19
7
372 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 83

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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

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 83

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
RESOURCE_SEMAPHORE waits - unexplained performance problem, BIG 20 51
Computer software inventory 5 81
server DNS address could not be found 22 131
2003 File Server upgrade 11 54
Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
Learn about cloud computing and its benefits for small business owners.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
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…

867 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

21 Experts available now in Live!

Get 1:1 Help Now