I have created two batch file that are working. Here is the outline
First Batch Calls another batch file
The second batch file changes to the directory on the application where the utility and command path to backup an asset resides, does the backup and places the file in C:\
I simple did a cd/ after the CALL command used to start second batch file to return to the path where the backup file is archived.
How do I use
set backupFilename=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%
or other function to Concatenate to the backup file?
FileName_05-21-2015:09:30 Pm.txt
I am getting an error that the file does not exist when in fact it does. My intention is to use AT command or Schtask command to schedule this backup process every week. I will also appreciate more descriptive application of this commands too with time stamp for every backup completed on schedule
Related
I am attempting to run a .bat file that within itself starts a pyton script that moves files within a directory on one drive to another directory on a different drive. I can run the file by hand successfully but when I schedule a task for it, the run result is 0x80070001 and:
The .bat file contains:
C:\Python37-32\python.exe "C:/wamp64/www/sgmvp_cloud_files/moveFiles.py"
How can I adjust my .bat file or the task itself to have access to both drives? I am running the task with the highest privledge and I am authorised to Log on as a batch job.
I have a shared Excel file on a network, and I want to create a backup each time the file is saved in case it gets overwritten or deleted by mistake.
I created a batch file to save a backup of the file with timestamp in the filename (found it here:https://datatofish.com/backup-file-timestamp/).
Now I'm looking for a way to trigger the batch file each time the file is saved so I will have a history of all the changes and backups in case of a problem. Is there a simple way to do that? Maybe using Task Scheduler? I've never used Task Scheduler so I would need a detailed description.
Thanks.
I have some files that are automatically generated by an external sources into a local machine each day.
I have batch script, which moves the data from that source folder into a destination folder.
So i would like to move the files using time and date. But the robocopy command only accepts date.
Please see the script below
robocopy \\IP\f$\EMAILMT\202 C:\IntellinxServices\Queues\SwiftGen\MT202 *.rje /MAXAGE:%NEWDATE%
I have a .bat file that use xcopy to pickup users pst file from document and setting then copy it to a shared drive. users always for get to double click to run it. How can I add time and date for the .bat file to run on its own. Windows build schedule doesn't work at time. thank you!
Batch files can't run on their own. Something has to launch the batch file.
You can use Windows Scheduler to schedule the running of the batch file, and then test for the time when the batch file is run in the batch file itself. If it's not the right time, the batch file can just exit; if it is the right time, the batch file can do the backup.
Scheduled tasks can run at a specified time; I have one that runs every weekday (Monday through Friday) at 8:45 AM that runs a process to retrieve files via FTP.
If you need more information about using Windows Scheduled Tasks, you should ask a question about it at SuperUser; that subject is not programming-related and would be off-topic here.
No idea what you mean by Windows build schedule doesn't work at time and you don't say when you want this backup to run - hourly? Weekly? Once a day?
What you could do is investigate the use of the AT command - that may suit you. Perhaps install a batch to run AT in your startup directory.
Or perhaps it would be better to start a hidden batch from the startup directory and use the TIMEOUT or CHOICE command to make it loop periodically.
You would need to explain your requirement in more detail.
I'm currently using APEX Data loader to download Raw files from Salesforce.
Using the command line I can download the data that I need by simply typing the command.
Now I need to schedule the task so I don't need to do it everyday.
I run the dataloader by typing in the following
C:/Program Files (x86)/salesforce.com/data loader/bin/process.bat C:/datadownload/
C:/datadownload contains the configuration file I need to connect to Salesforce.
How can I set this thing up with Task Scheduler?
Resolved By creating another batch file... CALLing the Process.bat and adding the location of the file
Create another batch file with the same command - note the double quotes - and schedule that batch file in task scheduler. When you've done that then launch the scheduled task manually (right click on the task) to test that it works. Provide credentials and an account if it is to run when you aren't logged in.
I added the call command in case you want to add any post-processing tasks to the batch file later.
#echo off
call "C:/Program Files (x86)/salesforce.com/data loader/bin/process.bat" C:/datadownload/