Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

General batch file/login script question

- - - - -

  • Please log in to reply
4 replies to this topic

#1
Cyrius

Cyrius

    Newbie

  • Member
  • 41 posts
  • Joined 10-October 11
  • OS:Windows 7 x64
  • Country: Country Flag
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, 08 November 2011 - 12:22 PM.



How to remove advertisement from MSFN

#2
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,071 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

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
allen2

allen2

    Not really Newbie

  • Member
  • PipPipPipPipPipPipPip
  • 1,804 posts
  • Joined 13-January 06
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
Cyrius

Cyrius

    Newbie

  • Member
  • 41 posts
  • Joined 10-October 11
  • OS:Windows 7 x64
  • Country: Country Flag
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
Cyrius

Cyrius

    Newbie

  • Member
  • 41 posts
  • Joined 10-October 11
  • OS:Windows 7 x64
  • Country: Country Flag
Yzöwl: It appears that this worked. Thanks!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users