Reputation: 88
I want to change the command :
copy "D:\Folder\File.txt" "C:\Folder\File.txt"
to :
copy "%current path%\File.txt" "C:\Folder\File.txt"
Is there any way to type like this?
Upvotes: 4
Views: 1484
Reputation: 57252
copy "%cd%\some.file" "c:\there\some.file"
or
copy "%~dp0some.file" "c:\there\some.file"
they are different - %cd%
is the current executable directory and %~dp0
is where the bat file is in case the SHIFT command is not called.Also %~dp0
cannot be used from the command line as there is no script file.
Upvotes: 3