Solved

What do 'REM' and '/persistent:no' mean in Windows Server 2003 .bat logon script files?

Posted on 2006-11-23
8
2,738 Views
Last Modified: 2008-03-10
Hi there. I hope this is an easy one that some helpful person out there could help me clear up quickly :)

I'm editing someone else's Windows Server logon scripts, and I'd just like confirmation of 2 phrases recoocuring in the scripts. The first is 'REM'. My guess is that when this is put at the start of a line, it actually turns the line into a 'comment' as such, and the code on that line is ignored when the script is run. Am I right?

Secondly, what does the '/persistent:no' mean that is placed at the end of most lines in the scripts. Again I can hazzard a few guesses, but don't want to take chances.

Any help from anyone is greatly apprecaited :D

Bluemercury
0
Comment
Question by:bluemercury
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 16

Accepted Solution

by:
InteraX earned 167 total points
ID: 18003423
Hi bluemercury,

REM = Remark. Comment out a command so that it doesn't take effect.
Persistent:no = do not remember the mapping between log of and log on.

Good Luck,

Chris
0
 
LVL 3

Assisted Solution

by:Stekman99
Stekman99 earned 167 total points
ID: 18003430
REM is for REMARK and is just for information.

This is a fairly old KB but might give you the info you are looking for:
http://support.microsoft.com/kb/79809

Cheers,
Stefan
0
 
LVL 1

Author Comment

by:bluemercury
ID: 18003464
Thanks guys - that was an impressively quick response!!!

So Chris, just to check, when you say "do not remember the mapping between log of and log on" does this mean that any kind of drive letter mappings to network shares that may have been applied via a script are guaranteed to be forgotten by the system when the user the script applies to logs off? If 'persistent:no' wan't applied, would the system potentially remember things even if I changed elements in the script later?

Many thanks to both of you :)
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 43

Assisted Solution

by:Steve Knight
Steve Knight earned 166 total points
ID: 18003478
BTW you don't need persistent:no on all the individual entries more than likely.  I put this at the beginning of the script:

REM Turn off persistent drive mappings (don't keep them after reboot)
net use /persistent:no

Persistent drive mappings mean if the script never runs again it will still have the drive mappings on the users PC even after a reboot.  Problem with that is if you move anything around or users passwords change things get messy and you need to remove drive mappings in the login script with net use x: /delete  to remove the specific X: one or net use * /delete to delete all.

Anyway you already have answers to your actual questions above....

Steve
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 18003491
To answer your second Q if it hasn't been my post which crossed with yours.... by default yes a drive mapping will be remembered unless you add /persistent:no on Windows 2000/XP at least which is why I add a general "no" command to the beginning of the script to effect all mappings.

Steve
0
 
LVL 16

Expert Comment

by:InteraX
ID: 18003559
bluemercury,

I think dragon-it summed it all up for me. ;-)
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 18003595
Sorry, as is often the case around here, I started typing an answer, got called away and when submitted the other two had already got there.
0
 
LVL 1

Author Comment

by:bluemercury
ID: 18003652
You've all been really helpful guys. Just saw your link, Stekman99, for the Microsoft article as well, which is proving invaluable.

Thanks to all three of you - I will split the points 3 ways.

Now I've just got to decode this spralling script I've been represented with, and find out exactly what it is doing!!

Many thanks again - great help :)

Bluemercury
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface Having the need * to contact many different companies with different infrastructures * do remote maintenance in their network required us to implement a more flexible routing solution. As RAS, PPTP, L2TP and VPN Client connections are no…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question