So i need to push a batch script out as a login script through Group Policy
Batch Script Example:
@echo off
Set USPS=%1 %2
Command %USPS%
I'm using a VB Script to call the .bat file
VB Script
Dim var1, var2
Set objShell = WScript.CreateObject("WScript.Shell")
'Parameter1, begin with index0
var1 = WScript.Arguments(0)
'Parameter2
var2 = WScript.Arguments(1)
objShell.Run "Script.bat" var1 & var2, 0, True
I'm placing parameters in the script parameters text box in group policy
So what im trying to do is pass the two parameters (Username and Password)to the VB Script then have the VB Script pass them to the batch file but it isn't passing them any like to point out where im messing up?
I'm doing it this way because i need to hide the username and password so i cant put them inside the scripts.
Thanks
Here's how you can grab the args to your script and pass them along: