# A.D. Login script

**URL:** <https://forums.suse.com/t/a-d-login-script/24271>\
**Category:** Chatting over the Back Fence\
**Created:** [August 13, 2013, 1:40am UTC](https://forums.suse.com/t/a-d-login-script/24271 "2013-08-13T01:40:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![System1](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@System1](https://forums.suse.com/u/System1)\
**Post date:** [August 13, 2013, 1:40am UTC](https://forums.suse.com/t/a-d-login-script/24271/1 "2013-08-13T01:40:33Z")

</div>

Trying to set a login script for my Administrator user that deletes a  
mapped drive when logging in. I have a batch file, one line in it:

net use \* /delete /Y

Works fine on XP boxes, but haven’t had any luck on 2003 or 2012. If I  
run it manually from any box it works fine, just not from the login  
script.

The path I have for the script location is:

\\domain-name\ETLOGIN\batch.bat

Any suggestions as to what I’m missing to get this to work properly? I  
could create a scheduled task or start menu item to do this, but I  
don’t want to have to touch over 50 boxes to do this.

Any suggestions?

PS, things like this are SOOOOOOOOOOOO much easier in  
eDirectory…sigh

–  
Stevo

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [August 13, 2013, 1:55am UTC](https://forums.suse.com/t/a-d-login-script/24271/2 "2013-08-13T01:55:03Z")

</div>

Path is \\domain-name\ETLOGON\batch.bat, not netlogIn… 😑

–  
Stevo

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [August 13, 2013, 2:17am UTC](https://forums.suse.com/t/a-d-login-script/24271/3 "2013-08-13T02:17:56Z")

</div>

Stevo:

Have you tried a wait command for a period of time, to see if it works  
after waiting? It could just be a timing issue. It’s been a long time  
since I’ve done batch commands, but I’m pretty sure there’s one that  
waits and you can set the amount of time of the wait. I could be  
getting it mixed up with macro programming, though.

My thought was that there might need to be time for the network  
connection to complete before access to the drive containing the batch  
file is available : )

–  
Susan  
Novell Community Chat Moderator

[http://forums.novell.com/faq.php?faq=novfor#faq\_rules](http://forums.novell.com/faq.php?faq=novfor#faq_rules)  
[http://www.ncci.org](http://www.ncci.org) NCCIrregulars Web Site  
[https://www.facebook.com/groups/NCCIrregulars](https://www.facebook.com/groups/NCCIrregulars)

Please read the following before posting in here:  
[http://preview.tinyurl.com/27zopdy](http://preview.tinyurl.com/27zopdy)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [August 13, 2013, 4:40pm UTC](https://forums.suse.com/t/a-d-login-script/24271/4 "2013-08-13T16:40:35Z")

</div>

Susan sounds like they ‘said’:  
[color=blue]

> Stevo:
> 
> Have you tried a wait command for a period of time, to see if it works  
> after waiting? It could just be a timing issue. It’s been a long time  
> since I’ve done batch commands, but I’m pretty sure there’s one that  
> waits and you can set the amount of time of the wait. I could be  
> getting it mixed up with macro programming, though.
> 
> My thought was that there might need to be time for the network  
> connection to complete before access to the drive containing the batch  
> file is available : )[/color]

So my response to Susan’s comment is…

Hmmmmm, I’ll look into that. I already have some batch files for other  
tasks that have a command that will wait X seconds, I’ll let ya know.

–  
Stevo

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [August 13, 2013, 5:25pm UTC](https://forums.suse.com/t/a-d-login-script/24271/5 "2013-08-13T17:25:26Z")

</div>

Susan sounds like they ‘said’:  
[color=blue]

> Stevo:
> 
> Have you tried a wait command for a period of time, to see if it works  
> after waiting? It could just be a timing issue. It’s been a long time  
> since I’ve done batch commands, but I’m pretty sure there’s one that  
> waits and you can set the amount of time of the wait. I could be  
> getting it mixed up with macro programming, though.
> 
> My thought was that there might need to be time for the network  
> connection to complete before access to the drive containing the batch  
> file is available : )[/color]

So my response to Susan’s comment is…

Got it working, I added a command to delay the net use command, but I  
think what did it was removing the unc path from the script in the user  
profile.

–  
Stevo

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [August 13, 2013, 6:36pm UTC](https://forums.suse.com/t/a-d-login-script/24271/6 "2013-08-13T18:36:13Z")

</div>

Very glad you were able to figure it out. : )

–  
Susan  
Novell Community Chat Moderator

[http://forums.novell.com/faq.php?faq=novfor#faq\_rules](http://forums.novell.com/faq.php?faq=novfor#faq_rules)  
[http://www.ncci.org](http://www.ncci.org) NCCIrregulars Web Site  
[https://www.facebook.com/groups/NCCIrregulars](https://www.facebook.com/groups/NCCIrregulars)

Please read the following before posting in here:  
[http://preview.tinyurl.com/27zopdy](http://preview.tinyurl.com/27zopdy)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [August 13, 2013, 7:13pm UTC](https://forums.suse.com/t/a-d-login-script/24271/7 "2013-08-13T19:13:52Z")

</div>

Susan sounds like they ‘said’:  
[color=blue]

> Very glad you were able to figure it out. : )[/color]

So my response to Susan’s comment is…

Me too!

–  
Stevo

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [August 13, 2013, 9:02pm UTC](https://forums.suse.com/t/a-d-login-script/24271/8 "2013-08-13T21:02:43Z")

</div>

On Tue, 13 Aug 2013 14:25:26 +0000, Stevo wrote:  
[color=blue]

> Susan sounds like they ‘said’:  
> [color=green]
> 
> > Stevo:
> > 
> > Have you tried a wait command for a period of time, to see if it works[/color]
> 
> So my response to Susan’s comment is…
> 
> Got it working, I added a command to delay the net use command, but I  
> think what did it was removing the unc path from the script in the user  
> profile.[/color]

In removing the unc path, You solved my problem too. In my case it  
worked for some people most of the time but not for everybody every time.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [August 13, 2013, 9:33pm UTC](https://forums.suse.com/t/a-d-login-script/24271/9 "2013-08-13T21:33:28Z")

</div>

Bob Crandell sounds like they ‘said’:  
[color=blue]

> In removing the unc path, You solved my problem too. In my case it  
> worked for some people most of the time but not for everybody every  
> time.[/color]

So my response to Bob’s comment is…

Well I’m glad I could help.

–  
Stevo
