Solved

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

Posted on 2006-11-23
8
2,612 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

I have never ceased to be amazed how many problems you can encounter on a fresh install of a Windows operating system.  This is certainly case in point& Unable to complete ANY MSI installation.  This means Windows Updates are failing and I can't …
Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now