Only the fact that whomever I send it to has to change it. Trivial for us, but 
I'm betting someone will screw it up and call me :)

The %0\..\ is how you call an executable from a the same location as where the 
batch file is running if the batch file has been called via UNC. Most commonly 
seen in legacy logon batch files:

@echo off
%0\..\wkix.exe %0\..\Login.k2k

As long as these two files are in the same folder that the script was called 
from, this will call WKIX.EXE and pass Login.k2k to WKIX.EXE.  It won't care 
what domain controller the system has logged in to.

Dave


From: Crawford, Scott [mailto:crawfo...@evangel.edu]
Sent: Thursday, June 07, 2012 10:26 AM
To: NT System Admin Issues
Subject: RE: Is there a way...

What don't you like about it?  seems pretty straightforward to me.

What's the %0 trick, btw. As far as I know, that just returns the name of the 
batch file.

From: David Lum [mailto:david....@nwea.org]<mailto:[mailto:david....@nwea.org]>
Sent: Thursday, June 07, 2012 12:20 PM
To: NT System Admin Issues
Subject: RE: Is there a way...

That does work. I don't like it, but it works (I need to distribute this batch 
file, but this might work OK).

Dave

From: Ken Cornetet 
[mailto:ken.corne...@kimball.com]<mailto:[mailto:ken.corne...@kimball.com]>
Sent: Thursday, June 07, 2012 9:52 AM
To: NT System Admin Issues
Subject: RE: Is there a way...

What about
for /f "tokens=1-5 " %%d in ('%LOGONSERVER%\NETLOGON\FILEVER 
"%SystemRoot%\system32\Macromed\Flash\Flash*.ocx" /A /D') do set FLASHVER=%%g



From: David Lum [mailto:david....@nwea.org]<mailto:[mailto:david....@nwea.org]>
Sent: Thursday, June 07, 2012 12:22 PM
To: NT System Admin Issues
Subject: RE: Is there a way...

I need to figure out a way to make this work?

FILEVER.EXE is in \NETLOGON.   If I map a drive it works (B: = 
\\DC\netlogon<file:///\\DC\netlogon>)

for /f "tokens=1-5 " %%d in ('B:\FILEVER 
"%SystemRoot%\system32\Macromed\Flash\Flash*.ocx" /A /D') do set FLASHVER=%%g

If I try and use the %0\..\ trick it does not
for /f "tokens=1-5 " %%d in ('%0\..\FILEVER 
"%SystemRoot%\system32\Macromed\Flash\Flash*.ocx" /A /D') do set FLASHVER=%%g

David Lum
Systems Engineer // NWEATM
Office 503.548.5229 // Cell (voice/text) 503.267.9764


~ 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 
listmana...@lyris.sunbeltsoftware.com<mailto:listmana...@lyris.sunbeltsoftware.com>
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 
listmana...@lyris.sunbeltsoftware.com<mailto:listmana...@lyris.sunbeltsoftware.com>
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 
listmana...@lyris.sunbeltsoftware.com<mailto:listmana...@lyris.sunbeltsoftware.com>
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 
listmana...@lyris.sunbeltsoftware.com<mailto:listmana...@lyris.sunbeltsoftware.com>
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 listmana...@lyris.sunbeltsoftware.com
with the body: unsubscribe ntsysadmin

Reply via email to