Converting a login.bat to login.wsh 
Author Message
 Converting a login.bat to login.wsh

I am trying to Convert  my login.bat script to the new windows script host.
I am able to map drives and such but what is the equivelent to
net use p: /home
net time \\amachine /set /y


Sat, 16 Nov 2002 03:00:00 GMT  
 Converting a login.bat to login.wsh

Unfortunately, the wscript object model doesn't support equivalents for these.  Your best bet is to do this in the .bat file that starts your .vbs logon script.  Otherwise, from your .vbs script, create a wscript.shell object and use the run method to execute the net commands in hidden console windows.

You might want to look around at Clarence's site for sample logon scripts...

http://cwashington.netreach.net/script_repository/repository.asp?Scri...

--
Michael Harris
MVP Scripting

I am trying to Convert  my login.bat script to the new windows script host.
I am able to map drives and such but what is the equivelent to
net use p: /home
net time \\amachine /set /y



Sat, 16 Nov 2002 03:00:00 GMT  
 Converting a login.bat to login.wsh
Ok here it goes;
I took you advice which has been tremendous help and I manage to through
together a login script which works good. The only problem is, when I call
to the shell to issue dos commands those processes will finish but will
still remain resident. In other words they don't terminate themselves. I'm
at this point not sure how to approach this. Im not sure if I should attack
this not sure how to kill the process once it is finnished
wshshell.run "net time \\somemachine /set /yes",0,false
wshshell.run "net use p: /home /yes",0,false
_________________________________________________


Quote:
> I am trying to Convert  my login.bat script to the new windows script
host.
> I am able to map drives and such but what is the equivelent to
> net use p: /home
> net time \\amachine /set /y



Sat, 23 Nov 2002 03:00:00 GMT  
 Converting a login.bat to login.wsh
Try:

shell.run "%comspec% /c <dos command>", 0, true

--
Michael Harris
MVP Scripting

Ok here it goes;
I took you advice which has been tremendous help and I manage to through
together a login script which works good. The only problem is, when I call
to the shell to issue dos commands those processes will finish but will
still remain resident. In other words they don't terminate themselves. I'm
at this point not sure how to approach this. Im not sure if I should attack
this not sure how to kill the process once it is finnished
wshshell.run "net time \\somemachine /set /yes",0,false
wshshell.run "net use p: /home /yes",0,false
_________________________________________________


Quote:
> I am trying to Convert  my login.bat script to the new windows script
host.
> I am able to map drives and such but what is the equivelent to
> net use p: /home
> net time \\amachine /set /y



Sat, 23 Nov 2002 03:00:00 GMT  
 Converting a login.bat to login.wsh
ok I tried that and it gives me an error that the script is set to run in
msdos mode. this caused some problems with my machine I had to restore my
old registry. It was stuck as set to ms dos mode but since no dos network
drivers where set it would error out and reboot. so that didnt work to well
im testing this on a win 98 machine since the majority of our machines on
the network are win98 is that helps.
is there a way to create like and object id then kill the object or would
that just remove the object and not take it out of as a task


Quote:
> Try:

> shell.run "%comspec% /c <dos command>", 0, true

> --
> Michael Harris
> MVP Scripting




Quote:
> Ok here it goes;
> I took you advice which has been tremendous help and I manage to through
> together a login script which works good. The only problem is, when I call
> to the shell to issue dos commands those processes will finish but will
> still remain resident. In other words they don't terminate themselves. I'm
> at this point not sure how to approach this. Im not sure if I should
attack
> this not sure how to kill the process once it is finnished
> wshshell.run "net time \\somemachine /set /yes",0,false
> wshshell.run "net use p: /home /yes",0,false
> _________________________________________________



> > I am trying to Convert  my login.bat script to the new windows script
> host.
> > I am able to map drives and such but what is the equivelent to
> > net use p: /home
> > net time \\amachine /set /y



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

 Relevant Pages 

1. login.bat -> login.vbs help required

2. Unable to run .exe and .bat from in WSH during login

3. Custom WSH login *before* Client32 login?

4. if pw change required, login.bat fails

5. if change password required, login.bat fails

6. NH: Need to have user login with their NT login

7. access denied to wscript at login but runs after login

8. WSH/VBS Login Script Calls

9. WSH Login Script

10. Win98 WSH Login Script to Windows 2000

11. WSH Login Scripts

12. WSH Login Scripts

 

 
Powered by phpBB® Forum Software