Page 1 of 1
How to move file into Archive Directory?
Posted: Thu Apr 11, 2013 8:13 pm
by pkll
Hi,
Code: Select all
Once my job is complete move that file already processed to some other directory as archive .
Please let me know how to move file into archive directoryr?
Posted: Thu Apr 11, 2013 9:06 pm
by chulett
On Windows, that would be by leveraging the
move command. And this illustrates how to get help on a specific DOS command which you get to by telling Windows you want to Run
cmd:
Code: Select all
C:\Users\Craig>move /?
Moves files and renames files and directories.
To move one or more files:
MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination
To rename a directory:
MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2
[drive:][path]filename1 Specifies the location and name of the file
or files you want to move.
destination Specifies the new location of the file. Destination
can consist of a drive letter and colon, a
directory name, or a combination. If you are moving
only one file, you can also include a filename if
you want to rename the file when you move it.
[drive:][path]dirname1 Specifies the directory you want to rename.
dirname2 Specifies the new name of the directory.
/Y Suppresses prompting to confirm you want to
overwrite an existing destination file.
/-Y Causes prompting to confirm you want to overwrite
an existing destination file.
The switch /Y may be present in the COPYCMD environment variable.
This may be overridden with /-Y on the command line. Default is
to prompt on overwrites unless MOVE command is being executed from
within a batch script.
For generic help (i.e. a list of commands) type
help at the command line.
On UNIX (or on Windows with the MKS Toolkit installed) you would use the very similar
mv command. So basically you specify the current name and location of the file and then the directory you want to move it to.
You could write a script or batch file to make this as complicated as you needed or you may be able to use ExecDOS after job to effect the move, it's all up to you.