145 results found for %~dp0
Equivalent of %~dp0 in sh Equivalent of %~dp0 in sh I'm converting some Windows batch files to Unix scripts using sh. I have problems because some
What does %~dp0 mean, and how does it work? What does %~dp0 mean, and how does it work? I find %~dp0 very useful, and I use it a lot to make my batch
shorten that to %~dp0 From Get-ScriptDirectory to the Rescue blog entry ... function Get-ScriptDirectory { $Invocation = (Get-Variable MyInvocation -Scope
nice.bat I am c:\tmp\foo\nice.bat Tags: batch %~dp0 from memory is the full path to the batch file. EDIT For more variable substitution run call /? Use %0
and drive, you can use: echo %~dp0 You can get a lot more information using different modifiers: %~I - expands %I removing any surrounding quotes (")
question but: The current directory is held in the pseudo-variable %CD% Getting the directory that the Batch file is located in can be done as follows: %~dp0
Please help me Tags: batch-file Maybe this? xcopy /E /Y "%~dp0\DagwoodLoki@hp.com\*" C:\Loki %~dp0 is substituted with drive+path to the batch file,
"tokens=%i% delims=\" %%a in ("%CD%") do if not "%%a" == "" set lastdir=%%a& goto nextdir echo Current location: %lastdir% %~dp0 This expands into the drive &
%~dp0 Try setting working directory like this process.StartInfo.WorkingDirectory = "C:\"; Also, try few other options as mentioned here,
Possible duplicate: http://stackoverflow.com/q/659647/587279 You can write %~dp0 to get the directory containing the .bat file.