Guest_imported
New member
- Jan 1, 1970
- 0
I wrote a little Logon Script in VBScript. The Script runs fine when called on the command line (Cscript SCRIPTNAME) no matter if it is called on a Win98 or NT machine.
I used a Logon.bat (used if %OS%==Windows_NT ....) to call the script via cscript at logon. The Script runs fine on NT but i get an error on the Win98 Computer.
The Error points to this line: "strUsername = WshNetwork.UserName"
Why is this working from command line and not while login? I searched the MS Knowlegebase and found that on 95 and 98 i have to use something like this:
While strUsername = ""
strUsername = WshNetwork.UserName
WEnd
I did it, but the error still points to the line where i want to get the Username. I tried the following:
"WScript.Echo "ComputerName = " & WshNetwork.ComputerName"
getting this line on the Screnn: "ComputerName = "
Is the WshNetwork Object not working on login? Is there another way to get the Username? I need it for a logon script for 95/98/NT.
Thanks
Martin
I used a Logon.bat (used if %OS%==Windows_NT ....) to call the script via cscript at logon. The Script runs fine on NT but i get an error on the Win98 Computer.
The Error points to this line: "strUsername = WshNetwork.UserName"
Why is this working from command line and not while login? I searched the MS Knowlegebase and found that on 95 and 98 i have to use something like this:
While strUsername = ""
strUsername = WshNetwork.UserName
WEnd
I did it, but the error still points to the line where i want to get the Username. I tried the following:
"WScript.Echo "ComputerName = " & WshNetwork.ComputerName"
getting this line on the Screnn: "ComputerName = "
Is the WshNetwork Object not working on login? Is there another way to get the Username? I need it for a logon script for 95/98/NT.
Thanks
Martin