• Announcements

    • xper

      MSFN Sponsorship and AdBlockers!   07/10/2016

      Dear members, MSFN is made available via subscriptions, donations and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, become a site sponsor and ads will be disabled automatically and by subscribing you get other sponsor benefits.
Sign in to follow this  
Followers 0
Cyrius

General batch file/login script question

5 posts in this topic

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

Edited by Cyrius
0

Share this post


Link to post
Share on other sites

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 ...

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.