Solved

Logon script config needed

Posted on 2009-05-19
7
375 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Suggested Solutions

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…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

752 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