Page 1 of 1

Batch script to: create, record, archiving

Posted: 29 Jan 2022 10:16
by John Doe
Hello everyone! Could you, guys, help with this bath script:
  1. Creates in the current directory (in which the bat-file is located) a directory"Screenshots_current_date" and moves there from the current directory all files with the extension specified as the first parameter passed from the command line.
  2. Writes the names of all moved files to the d:\screenshots.found file (appends to the end of the file or creates a new one if there was none), which is located in the same directory as a launched batch file.
  3. Archives a folder with the moved files and deletes its original.
  4. Waiting for any key to be pressed to complete.
Thanks!

Re: Batch script to: create, record, archiving

Posted: 29 Jan 2022 11:56
by ShadowThief
This sounds like homework, so I'll be vague.
1.Creates in the current directory (in which the bat-file is located) a directory"Screenshots_current_date" and moves there from the current directory all files with the extension specified as the first parameter passed from the command line.
mkdir /?
move /?
2.Writes the names of all moved files to the d:\screenshots.found file (appends to the end of the file or creates a new one if there was none), which is located in the same directory as a launched batch file.
for /?
3.Archives a folder with the moved files and deletes its original.
tar --help
4. Waiting for any key to be pressed to complete.
pause /?