Is there any way to specify the archive file with the "-f" option as an absolute path? For example "tar -cvf d:/test.tar files..." will not work, I have to use "tar -cvf /test.tar files..." but then the file ends up in the wrong drive. This will be called out of a script and I am not always going to be saving the file on the same drive. The reverse is not true, you can call "tar -cvf /test.tar e:\file e:\file ...." and it will work and archive the files. Thanks! - Jeremy
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there any way to specify the archive file with the "-f" option as an absolute path? For example "tar -cvf d:/test.tar files..." will not work, I have to use "tar -cvf /test.tar files..." but then the file ends up in the wrong drive. This will be called out of a script and I am not always going to be saving the file on the same drive. The reverse is not true, you can call "tar -cvf /test.tar e:\file e:\file ...." and it will work and archive the files. Thanks! - Jeremy
The only way I have found, to make this happen is with the -C argument.
change your current path to your D:/ then use
tar -cvf test.tar -C //./X:/Source/Folder ./
And works the same way when extracting, change your path to the drive the archive is on and then use the same command syntex.