Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where do I place the .vbs files???

Status
Not open for further replies.

Ajb2528

Technical User
Feb 22, 2002
270
GB
Hi!!

I am trying to create a login script through bat files and Windows Script Host. Examples are shown below:

logon.bat

@ECHO OFF
erase c:\windows\*.pwl
:: run=logon.bat
:: Check Windows version
IF %OS% == "Windows_NT" GOTO WNT

%0\..\winset OS=Windows_95
%0\..\winset USERDOMAIN=SUPPORT
if not exist %windir%\net.pif copy %0\..\net.pif %windir%\net.pif
if not exist %windir%\wscript.exe start /wait %0\..\scr56en.exe /q
cscript.exe %0\..\REGISTRY-AJB.VBS //B //NOLOGO

net use * /delete /yes
net use K: \\server2\Admin2
net use L: \\server2\Database
GOTO end
:WNT
if not exist %windir%\system32\wscript.exe /wait %0\..\scripten.exe /q
cscript.exe %0\..\REGISTRY-AJB.VBS //B //NOLOGO
net use * /delete /yes
net use K: \\server2\Admin2 /persistent:no
net use L: \\server2\Database /persistent:no
:end

REGISTRY-AJB.VBS

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")

WSHShell.RegWrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\Proxy", 1, "REG_DWORD"

Both of these are placed into the correct place on the server but the VBS script does not run on the client (I does if you copy it across and then double-click it from explorer)

Any Ideas anyone??

Regards,

Alan



 
Ajb2528,

Manage Registry Via Wmi...

I'm trying to automate modifying and deleting several Registry keys

Goto Google and use "wmi registry script" as your search string. You will find a wealth of info. Sample scripts at MS too. Search for "scriptomatic" in google. Tool from MS to create sample WMI scripts. Place to start.

Hope this helps.
DougCranston
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top