Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Logon script config needed

Posted on 2009-05-19
7
Medium Priority
?
377 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 85

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
Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 

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 85

Accepted Solution

by:
oBdA earned 2000 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
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…
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…

730 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