I've read through some other forums about creating a .bat file and running it through Task Scheduler, but I'm not having any success with it. Anyone here doing this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you just want to run a batch file once a VC volume is mounted, the simplest thing would be mount the volume with a batch file, which then goes on to launch the other program(s). I do this all the time.
If that's not it, you need to be more specific about what you are trying to acheive; eg run a backup program every hour? Or what? No problem in principle with running a batch file from Task Scheduler which requires a mounted VC volume; I do this occasionally.
Please provide more info, and I'll try to help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a dual drive laptop. The C drive boots windows . The D drive is an encrypted VeraCrypt volume. Once I log in to Windows, I would like to mount my D drive via Veracrypt, and then have a couple programs auto-run. Just a one time auto start - no backup, or scheduled task.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It seems to me you have two options: a. using Task Scheduler, run a batch file on logon that mounts your drive with VC, and then runs your programs, or b. use VC to mount your drive as a 'Favorite Volume' on logon, then use Task Scheduler to run a batch file that launches your programs after a short delay. It seems to me the latter option would be simpler.
If you choose the latter, what are you not familiar with? Creating Favorite Volumes via the VC GUI? Batch files in general? Or setting up tasks in Task Scheduler?
One thing at a time. I assume Task Scheduler might be the thing you are least familiar with, so I'll start with that. You can set up a task using a batch file, something like this (call it SID-Task.bat):
The task will run Time.bat 5 minutes after you logon, writing the time into a file in your desktop called Time.txt. You'll need to substitute your username for 'username' in SID-Task.bat.
The 'pause' in SID-Task.bat allows you to see any error or success message. If it succeeds, you can view the task via Run > control schedtasks. The task will be in the folder identified by your username's 'Security Identifier' (SID), hence the routine in SID-Task.bat to find and deploy that; this helps to avoid the task failing due to permissions errors.
Note that the task will only run when your username logs on, despite the 'any user' stated in the task; the /it switch guarantees that.
Note also that this has been tested on W10, and works if there are no spaces in paths, usernames etc.
If it works with the simple test suggested, then you can adapt it for any other batch file by changing the 'set' statements to reflect the required path and batch filename, and the delay time etc in 'set sch='.
I hope this is clear; post back if not.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've read through some other forums about creating a .bat file and running it through Task Scheduler, but I'm not having any success with it. Anyone here doing this?
If you just want to run a batch file once a VC volume is mounted, the simplest thing would be mount the volume with a batch file, which then goes on to launch the other program(s). I do this all the time.
If that's not it, you need to be more specific about what you are trying to acheive; eg run a backup program every hour? Or what? No problem in principle with running a batch file from Task Scheduler which requires a mounted VC volume; I do this occasionally.
Please provide more info, and I'll try to help.
I have a dual drive laptop. The C drive boots windows . The D drive is an encrypted VeraCrypt volume. Once I log in to Windows, I would like to mount my D drive via Veracrypt, and then have a couple programs auto-run. Just a one time auto start - no backup, or scheduled task.
It seems to me you have two options: a. using Task Scheduler, run a batch file on logon that mounts your drive with VC, and then runs your programs, or b. use VC to mount your drive as a 'Favorite Volume' on logon, then use Task Scheduler to run a batch file that launches your programs after a short delay. It seems to me the latter option would be simpler.
If you choose the latter, what are you not familiar with? Creating Favorite Volumes via the VC GUI? Batch files in general? Or setting up tasks in Task Scheduler?
One thing at a time. I assume Task Scheduler might be the thing you are least familiar with, so I'll start with that. You can set up a task using a batch file, something like this (call it SID-Task.bat):
I suggest you practice! Create a batch file on your desktop called Time.bat:
The task will run Time.bat 5 minutes after you logon, writing the time into a file in your desktop called Time.txt. You'll need to substitute your username for 'username' in SID-Task.bat.
The 'pause' in SID-Task.bat allows you to see any error or success message. If it succeeds, you can view the task via Run >
control schedtasks
. The task will be in the folder identified by your username's 'Security Identifier' (SID), hence the routine in SID-Task.bat to find and deploy that; this helps to avoid the task failing due to permissions errors.Note that the task will only run when your username logs on, despite the 'any user' stated in the task; the /it switch guarantees that.
Note also that this has been tested on W10, and works if there are no spaces in paths, usernames etc.
If it works with the simple test suggested, then you can adapt it for any other batch file by changing the 'set' statements to reflect the required path and batch filename, and the delay time etc in 'set sch='.
I hope this is clear; post back if not.