Re: Running Login Script after establishing a VPN connection




"TJCooper1972" <TJCooper1972@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C77632B4-B528-44BA-AAEE-7EE53DAD6D0D@xxxxxxxxxxxxxxxx
I want to create a script the user can run that pulls his
objuser.scriptpath
properties, and runs the login script specified.

Is there a way to simply restart the login process (the part that goes to
that location and runs the specified script)?

So far I have a script that get the correct field, but I dont know how to
run/launch a bat file using that information. Ive tried wscript.run and
wsshell.run, but they dont seem to work. Any suggestions?

Set oNet = Wscript.CreateObject("Wscript.Network")
Set ADSysInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://"; & ADSysInfo.UserName &"")
Set WshShell = CreateObject("Scripting.FileSystemObject")

Wscript.echo "Script Path: \\domain.loc\netlogon\ou\"& objUser.ScriptPath
'wscript.run "\\domain.loc\netlogon\ou\"& objUser.ScriptPath
'wshshell.run "\\domain.loc\netlogon\ou\"& objUser.ScriptPath


Set oNet = Wscript.CreateObject("Wscript.Network")
Set ADSysInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://"; & ADSysInfo.UserName &"")
Set WshShell = CreateObject("Scripting.FileSystemObject")


You bind wshShell to "Scripting.FileSystemObject" instead of
"Wscript.Shell". The FSO has no Run method, while Wscript.Shell does.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


.



Relevant Pages

  • Re: Running Login Script after establishing a VPN connection
    ... and runs the login script specified. ... Set oNet = Wscript.CreateObject ... Set ADSysInfo = CreateObject ... Set WshShell = CreateObject ...
    (microsoft.public.windows.server.scripting)
  • Re: Running Login Script after establishing a VPN connection
    ... Set ADSysInfo = CreateObject ... and runs the login script specified. ... Set oNet = Wscript.CreateObject ... Set WshShell = CreateObject ...
    (microsoft.public.windows.server.scripting)
  • Re: Running Login Script after establishing a VPN connection
    ... We are using kixart in our login process. ... Set ADSysInfo = CreateObject ... and runs the login script specified. ... Set WshShell = CreateObject ...
    (microsoft.public.windows.server.scripting)
  • Re: vbscript runonce key
    ... runonce key again to run the batch file and reboot the script runs all the ... Instead of invoking the script directly, ... Dim objComputer, strModel, strMfg, WshShell, oExec, strCommand ... Set WshShell = CreateObject ...
    (microsoft.public.scripting.vbscript)
  • Re: vbscript runonce key
    ... Instead of invoking the script directly, ... Dim objComputer, strModel, strMfg, WshShell, oExec, strCommand ... Elseif strModel = "OptiPlex 745" Then ... Set WshShell = CreateObject ...
    (microsoft.public.scripting.vbscript)

Loading