and how about copying the usefulexecutable.exe to some local place, then 
running it ? You probably could use UNC paths to copy it
  ----- Original Message ----- 
  From: David Lum 
  To: NT System Admin Issues 
  Sent: Saturday, March 05, 2011 4:30 AM
  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
  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