scripting

  • Thread starter Thread starter Tester
  • Start date Start date
T

Tester

Hello there,
How would I schedule to have every day a directory created with a
fixed name and the date appended at the end and to move contents of
another directory into this directory?
Thank you, T
 
Tester said:
Hello there,
How would I schedule to have every day a directory created with a
fixed name and the date appended at the end and to move contents of
another directory into this directory?
Thank you, T

Here you go:
@echo off
set Source=c:\Financial
set Target=c:\My Folder
set Name=Archive Folder

set MyDate=%Date:/=-%
if not exist "%Target%\%Name% %MyDate%" md "%Targete%\%Name% %MyDate%"
echo move /y "%Source%\*.*" "%Target%\%Name% %MyDate%"

Instructions:
1. Click Start/Run
2. Type this line, then click OK.
notepad c:\Windows\Calinguga.bat
3. Allow a new file to be created.
4. Copy & paste the above code into the notepad window.
Do not retype them - the risk of making a typing error is too great.
5. Use lines 2 to 4 to set your source directory, target directory
and folder name (to which the date will be appended).
6. Save the file.
7. Click Start/Run
8. Type the three letters cmd and press OK.
9. Type this command and press Enter:
Calinguga.bat
10. If you're satisfied with the command you will see on the screen,
remove the word "echo" from the last line and save the file again.
11. Type this command and press Enter:
Calinguga.bat
12. Check that the script did exactly what you expected.
13. Use the Task Scheduler via the Control Panel to schedule
c:\windows\Calinguga.bat to run every day at the required time.
14. Invoke the newly created task manually and check that it
has done the right thing.
 
Tester said:
Hello there,
How would I schedule to have every day a directory created with a
fixed name and the date appended at the end and to move contents of
another directory into this directory?
Thank you, T

alt.msdos.batch.nt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top