Logon Scripts - CScript vs WScript?

  • Thread starter Thread starter Gerry Hickman
  • Start date Start date
G

Gerry Hickman

Hi,

I've been testing logon scripts and notice a potential issue with the script
host. Some of my machines have CScript as the default and some have WScript.

If I set up user logon scripts from within GP they run under DIFFERENT hosts
depending on which is set as default! This is somewhat unexpected meaning
you can't rely on a specific environment (e.g. WScript does not support
StdOut).

(We tend to have WScript on user machines and CScript on developer machines)
 
And the question is ??
One can always test what host is being used and can also cause the
same script to run under the other host if found needed.
However, why not just avoid things that are different ?? particularly
any form of user prompting / informative display.
 
Hi Roger,

Roger Abell said:
And the question is ??

The question is, what are the implications?
One can always test what host is being used and can also cause the
same script to run under the other host if found needed.

You can easily "test what host is being used", but I'm not sure how you'd
"casue the same script to run under the other host"?
However, why not just avoid things that are different ?? particularly
any form of user prompting / informative display.

Yup, that's pretty much what I've done. I've created my own string buffer
class to handle all output to a centralized log file. I've kept it all as
neutral as possible. I just don't like inconsistencies in my environments!
 
Hi,

Then just write the scripts to call the host. In my domain WScript is the
default Host on all the machines. However, 99% of my VBScripts won't run
unless we use CScript.

Therefore, I have a batch file call my VBScripts.

cscript \\server\netlogon\myscript.vbs

This works great.

Cheers,
Lara
 
Hi Lara,

So basically you wrap the call in a batch file, and then set the path to
the batch file from within GP editor Logon script policy?

I can see this makes perfect sense, but I tend to think of batch files
for "legacy" NETLOGON scripts, and wsf files (with JScript inside in my
case) for "new" GP defined scripts.

I can't see any reason not to use a BAT file wrapper though, thanks!

Anyway, my new logon scripts have been running the last two days and
work perfectly, much more useful than I ever imagined. I've been able to
clean up HKCU hives from junk stretching back years.
 
Back
Top