Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

VBSript In GPO will not create Wscript.Shell object

$
0
0

Hi Scripters!

I have written a dynamic logon script where admins can simply manage which user gets which printer mapped etc. (Doesn't matter at all)

In the first lines of my script I am trying to initialize a WScript.Shell object for different things I need later in my script.

set WshShell = WScript.CreateObject("WScript.Shell")

userName = UCase(WshShell.ExpandEnvironmentStrings("%Username%"))

After getting the object, for example, I use it to get the username variable..

When I (or somebody else) starts the script directly everything works perfect, but when the script is called via GPO the WshShell object is empty and I could not get the username. (The username is not the only thing I need from this object..)

Windows 7 and Server 2008 but with some XP Clients so I dontn want to use powershell for now.

Do you have any Ideas??

Thanks in advance!


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>