Re: how to get the bat file self's path in a bat file?
- From: "Torgeir Bakken \(MVP\)" <Torgeir.Bakken-spam@xxxxxxxxx>
- Date: Fri, 31 Mar 2006 17:50:12 +0200
hantechs@xxxxxxxxx wrote:
Is there a way to get the bat file self 's path in a bat file?ThxHi,
To get the path not including the bat file name, you need to parse %0:
@echo off
set scriptpath=%~d0%~p0
echo %scriptpath%
For more on the %~ parameters, at the command prompt enter "FOR /?"
--
torgeir, Microsoft MVP Scripting, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
.
- References:
- how to get the bat file self's path in a bat file?
- From: hantechs
- how to get the bat file self's path in a bat file?
- Prev by Date: Re: A question about licencing
- Next by Date: Re: Sound Card Drivers
- Previous by thread: how to get the bat file self's path in a bat file?
- Next by thread: Auto-complete
- Index(es):
Relevant Pages
|
|