WSH Login Scripts 
Author Message
 WSH Login Scripts

Hi,

I was flicking through the Win98 resource kit a few days back, and read that
with WSH installed, you can use WSH for running login scripts on Win95, 98
and NT.  I thought this was great, and jumped onto our NT Server the next
morning, built a quick test script which ran a couple if loops, and mapped a
couple of drives; then I entered the script name into the "Login Script"
text box in User Managers user-profile dialog, and logged into a local
client machine.  I suppose I shouldn't have been shocked when it didn't
work, but I was.  Are there any changes or configuration that I have to make
anywhere to enable wsh login scripts, or do I have to revert to calling the
script from a DOS batch file (which seems convoluted, and not the huge step
forward the 98 ResKit promised)?

Another problem I have is when using a vbs file from a *.bat login script.
If I try to call WshNetwork.Username, I get an error saying that the user
isn't logged into a network, and this is during the logon process!  Is this
a bug, and if so is there a work around?

TIA to all who can help.



Sun, 24 Nov 2002 03:00:00 GMT  
 WSH Login Scripts
You can use WSH from win95 and NT4, but it doesn't come with
them.  WSH 1.0 was first introduced with the NT Option Pack and
later included with win98 and Win2K.  If you want to use it with
NT4, you must install it.  While you're at it, WSH 2.0 is
included with the MS scripting engine 5.1 (the latest release)
and it's something that everyone should probably have anyway.
You might consider rolling it out with a .bat logon script then
switching to WSH.

-c


Quote:

>Hi,

>I was flicking through the Win98 resource kit a few days back,
and read that
>with WSH installed, you can use WSH for running login scripts
on Win95, 98
>and NT.  I thought this was great, and jumped onto our NT
Server the next
>morning, built a quick test script which ran a couple if loops,
and mapped a
>couple of drives; then I entered the script name into
the "Login Script"
>text box in User Managers user-profile dialog, and logged into
a local
>client machine.  I suppose I shouldn't have been shocked when
it didn't
>work, but I was.  Are there any changes or configuration that I
have to make
>anywhere to enable wsh login scripts, or do I have to revert to
calling the
>script from a DOS batch file (which seems convoluted, and not
the huge step
>forward the 98 ResKit promised)?

>Another problem I have is when using a vbs file from a *.bat
login script.
>If I try to call WshNetwork.Username, I get an error saying
that the user
>isn't logged into a network, and this is during the logon
process!  Is this
>a bug, and if so is there a work around?

>TIA to all who can help.

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!


Sun, 24 Nov 2002 03:00:00 GMT  
 WSH Login Scripts
A few thoughts:

* In Windows NT you need to use a .BAT file to execute a login script.
  It is not possible to launch a vbs/js script directly. This things has
  been changed since Windows 2000 (this support user login scripts
  associated to a user account, startup/shutdown scripts and logon/
  logoff scripts for all user).

Quote:
>Another problem I have is when using a vbs file from a *.bat login script.
>If I try to call WshNetwork.Username, I get an error saying that the user
>isn't logged into a network, and this is during the logon process!  Is this
>a bug, and if so is there a work around?

I know of a problem in Win 9x querying the user name. The login script
runs before the network connection is made. This can be solved with a
small workaround. Here is the code "out of my mind":

Set oWSHShell = WScript.CreateObject ("WScript.Network")
name = ""
Do While name = ""
 name = oWSHShell.UserName   ' query user name
 WScript.Sleep 200      ' suspend 200 milliseconds to lower CPU load
End

The loop given above tries cyclically to query the username till it is set.
Hope this helps.

G. Born
--
______________________________________________________
Check out the WSH Bazaar at www.borncity.de


Quote:
>Hi,

>I was flicking through the Win98 resource kit a few days back, and read
that
>with WSH installed, you can use WSH for running login scripts on Win95, 98
>and NT.  I thought this was great, and jumped onto our NT Server the next
>morning, built a quick test script which ran a couple if loops, and mapped
a
>couple of drives; then I entered the script name into the "Login Script"
>text box in User Managers user-profile dialog, and logged into a local
>client machine.  I suppose I shouldn't have been shocked when it didn't
>work, but I was.  Are there any changes or configuration that I have to
make
>anywhere to enable wsh login scripts, or do I have to revert to calling the
>script from a DOS batch file (which seems convoluted, and not the huge step
>forward the 98 ResKit promised)?

>Another problem I have is when using a vbs file from a *.bat login script.
>If I try to call WshNetwork.Username, I get an error saying that the user
>isn't logged into a network, and this is during the logon process!  Is this
>a bug, and if so is there a work around?

>TIA to all who can help.



Sun, 24 Nov 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. WSH Login Script

2. Win98 WSH Login Script to Windows 2000

3. WSH Login Scripts

4. Win98 WSH Login Script to Windows 2000

5. WSH - login scripting "if ingroup"

6. Using WSH login scripts to assign temp local system admin previllege

7. Creating Printers in a NT WSH login Script?

8. WSH Login Script Examples

9. Using a WSH Script as a Login Script

10. Executing a WSH script as a login script

11. Converting a login.bat to login.wsh

12. Custom WSH login *before* Client32 login?

 

 
Powered by phpBB® Forum Software