Instead of MyDC, you can use domain.com<http://domain.com> to eliminate the 
"always the same DC" problem. You can also use %logonserver%.

I'm not sure why you're mapping at all. Can't you just call 
\\MyDC\Netlogon\usefulexecutable.exe?

Finally, do you only want outlookplaceholder.cmd as a flag that the script has 
run? If so, I'd store that value in the registry. It's much less confusing for 
the user and you won't have to worry about them deleting it. Reg.exe is your 
friend here.



Sent from my Palm Pre on the Now Network from Sprint

________________________________
On Mar 5, 2011 1:31 AM, David Lum <[email protected]> wrote:

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]<mailto:[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