help on tar command

Hi,

I am using the following DOS command to tar my .gz file from the command prompt

C:\tar\bin>tar -cf test.tar D:\Coim\*.gz

but this creates a tar file under the path C:\tar\bin\test.tar but i want the tar file to be created under D:\Coim\test.tar

Is there any option in tar command to do so?

i tried with this command
C:\tar\bin>tar -cf D:\Coim\test.tar D:\Coim\*.zip
but this cmd throws an error,

tar: Cannot open D:\Coim\test.tar: Function not implemented
tar: Error is not recoverable: exiting now

Your best bet is probably to cd to D:\Coim before creating the tarball.

But my tar executable is present only in the C drive. exactly what happends in my code is

cd C:\tar\bin
C:\tar\bin> tar -cf test.tar D:\coim\*.gz

so the tar files get created under c:\tar\bin folder itself....

If i execute the command from the D drive it will throw an error
'tar' is not recognized as an internal or external command,
operable program or batch file.

Is there any option in tar command to create the files under different drive where the executabe is not available?

Option 1:

D:\coim\> C:\tar\bin\tar -cf test.tar *.gz

Option 2: Put the path to the tar binary in your %PATH%: Right click on "My Computer" -> Properties -> Advanced -> Environment Variables
Option 3:

C:\tar\bin\> tar -C D:\coim -cf test.tar D:\coim\*.gz

Thanks for your quick reply... its working fine.
i tried implementing it in different case as mentioned below

I have the tar.exe placed in my server and whose UNC is [\\lexington.group.com\test\tar](file://lexington.group.com/test/tar) so i mapped its Physical path as C:\Program files\tar and
my source files are present under [](file://lexington.group.com/test/tar)[\\lexington.group.com\test\source](file://\\lexington.group.com\test\source) which has the physical path e:\tesst\aad

so i have given the commands in the batch script to tar as

cd e:\tesst\aad
"C:\Program files\tar" --remove-files -pcf test.tar test_*.xml

Though the command shows no error, tar file is not placed under the path e:\tesst\aad
Any ideas why i could'nt find the tar file under e:\tesst\aad?

Another doubt
C:\tar\bin\> tar -C D:\coim -cf test.tar D:\coim\*.gz

this command is placing the test.tar file only under C:\tar\bin is there any change to be made on the command to place it under D:\coim?