MSFN Forum: General batch file/login script question - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

General batch file/login script question Rate Topic: -----

#1 User is offline   Cyrius 

  • Newbie
  • Group: Members
  • Posts: 41
  • Joined: 10-October 11
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 08 November 2011 - 12:17 PM

So I am using a login script to map drives and set a time server, but sometimes it is beginning commands before finishing the previous one, and the drives don't properly map.

Is there a way to pause the script/slow it down so that commands will finish?

I do not want to use the PAUSE command because it requires input from the user...

EDIT: Here is what I have, tried putting the time server command at the end to give it a short slowdown...

@echo off

net use /delete U: /yes

net use /delete W: /yes

net use U: \\SERVER\users\%UserName%

net use W: \\SERVER\public

NET TIME \\SERVER /SET /YES

This post has been edited by Cyrius: 08 November 2011 - 12:22 PM



#2 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,364
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 08 November 2011 - 01:43 PM

First of all, if you wish to add a pause you could use the ping command, alternatively I posted a method of adding a delay without using the ping command around 5½ years ago.

However for your needs, you could just try the Start command with the Wait switch:
...
START /WAIT net use /delete U: /yes

START /WAIT net use /delete W: /yes

START /WAIT net use U: \\SERVER\users\%UserName%

START /WAIT net use W: \\SERVER\public

NET TIME ...


#3 User is offline   allen2 

  • Not really Newbie
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,736
  • Joined: 13-January 06

Posted 08 November 2011 - 08:38 PM

Usually, it isn't the login script being too fast but the computer boot which allow the user to open the session before all network layers are up.

#4 User is offline   Cyrius 

  • Newbie
  • Group: Members
  • Posts: 41
  • Joined: 10-October 11
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 09 November 2011 - 12:51 PM

I will try the START /wait command.

allen2, it also happens when I manually run the batch, that is why I figured its flying thru too quickly.

#5 User is offline   Cyrius 

  • Newbie
  • Group: Members
  • Posts: 41
  • Joined: 10-October 11
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 16 November 2011 - 06:50 AM

Yzöwl: It appears that this worked. Thanks!

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy