Thinking about it, you could probably do all that with Group Policy 
Preferences, using conditional file and folder actions.

Typed frustratingly slowly on my BlackBerry® wireless device

-----Original Message-----
From: David Lum <[email protected]>
Date: Sat, 5 Mar 2011 07:30:03 
To: NT System Admin Issues<[email protected]>
Reply-To: "NT System Admin Issues" 
<[email protected]>Subject: And now: Fun with login scripts.

Is there a better way to do this via login script while still using batch 
(read: not VBS or PS)? Specifically avoid the drive mapping stuff. I have tried 
variations on %0\..\ but I can't qiute get it to work as it barfs on the IF 
statement. I could copy the file placeholder file instead of creating it on the 
fly, but then it doesn't like to run %0\..\usefulexecuable.exe

And yes I know this script is making everyone map to the same DC, another 
reason I'd like to do it sans drive mapping.
------------------
@echo off
net use B: \\MyDC\netlogon<file://mydc/netlogon>
b:
If exist "%USERPROFILE%\My Documents\Outlookplaceholder.cmd" goto alreadydone
echo @echo off > "%USERPROFILE%\My Documents\Outlookplaceholder.cmd"
echo echo Placeholder for outlook Migration, do not delete >> "%USERPROFILE%\My 
Documents\Outlookplaceholder.cmd"
echo pause >> "%USERPROFILE%\My Documents\Outlookplaceholder.cmd"
attrib +r "%USERPROFILE%\My Documents\Outlookplaceholder.cmd"
b:\usefulexecutable.exe
:alreadydone
net use B: /del /y
exit
------------------

Dave

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin

Reply via email to