Sorry every one.
I'm beginner at dos don't have experience.I have a problem.
file.xml c:\temp\stylesheets\Part\file.xml
file.bat in c:\temp\stylesheets\file.bat
So i want read file.xml from file.bat but i use path %~dp0\Parts\file.xml.The path don't work.
can i give me advice
Expand current directory
Moderator: DosItHelp
Re: Expand current directory
Show the output of this command, and always add double quotes on paths in batch.ngusaomanoi wrote:file.xml c:\temp\stylesheets\Part\file.xml
file.bat in c:\temp\stylesheets\file.bat
So i want read file.xml from file.bat but i use path %~dp0\Parts\file.xml.The path don't work.
Code: Select all
@echo off &setlocal disableDelayedExpansion
echo.if exist "%~dp0\Parts\file.xml"
if exist "%~dp0\Parts\file.xml" (
echo.exists
) else echo.notExists
pause
Re: Expand current directory
ngusaomanoi wrote:Sorry every one.
I'm beginner at dos don't have experience.I have a problem.
file.xml c:\temp\stylesheets\Part\file.xml
file.bat in c:\temp\stylesheets\file.bat
So i want read file.xml from file.bat but i use path %~dp0\Parts\file.xml.The path don't work.
can i give me advice
Is that a typo?
Part or Parts?
Re: Expand current directory
Whichever it is, use a relative path:
.\part\file.xml
or just
part\file.xml
.\part\file.xml
or just
part\file.xml
-
- Posts: 8
- Joined: 13 Nov 2012 20:27
Re: Expand current directory
Thanks you foxidrive it help my software active.
I think should use .\part\file.xml when i send file.bat another computer
Thanks you so much Ed Dyreen your source help me know where i have problem
because when i use %~dp0\Parts\file.xml -> directory\\parts\file.xml
i balance "\" this is reason my path don't work.
Once again thanks all people.
I think should use .\part\file.xml when i send file.bat another computer
Thanks you so much Ed Dyreen your source help me know where i have problem
because when i use %~dp0\Parts\file.xml -> directory\\parts\file.xml
i balance "\" this is reason my path don't work.
Once again thanks all people.
