Solved

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

Posted on 2006-11-23
8
2,883 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Numerous times I have been asked this questions that what is it that makes my machine log on so slow, there have been cases where computers took 23 minute exactly after taking password and getting to the desktop. Interesting thing was the fact th…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 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