Is it possible, in a batch file, to copy a file to the location of the batch file? For example: if I ran my batch file from the root of the F: drive (which is my USB thumb drive), I would like for the files in question to be copied to root of the F: drive as well. But if after I ran it from the C: drive, I would like those files to be copied to the C: drive. It seems like I would need an environment variable, but I couldn't find what I needed when I ran the SET
command in CMD. Any ideas?
Asked
Active
Viewed 113 times
0

user1599051
- 43
- 1
- 1
- 7
-
1see http://stackoverflow.com/questions/3827567/how-to-get-the-path-of-the-batch-script-in-windows – mti2935 Jul 23 '14 at 19:06
-
Or http://stackoverflow.com/questions/16255184/how-do-i-find-the-current-directory-of-a-batch-file-and-then-use-it-for-the-pat – Tom Jul 23 '14 at 19:08
-
It's difficult as one may be able to call your script without getting %0 reset. I hope I'm wrong. – konsolebox Jul 23 '14 at 19:08