I have a batch file that I'd like to run that shuts down the computer once the profile is complete.
Problem is, there's 2 profiles scheduled, & if one's still going when the other wants to shut down, it won't finish.
One's weekly & the other's monthly. The weekly one typically finishes within 2 days, while the monthly one maybe a week. It's likely one day they'll collide if I set this script.
Ideas?
TIA
Before posting, and to avoid disappointment, please read the following:
- This forum is not for 2BrightSparks to provide technical support. It's primarily for users to help other users. Do not expect 2BrightSparks to answer any question posted to this forum.
- If you find a bug in any of our software, please submit a support ticket. It does not matter if you are using our freeware, a beta version or you haven't yet purchased the software. We want to know about any and all bugs so we can fix them as soon as possible. We usually need more information and details from you to reproduce bugs and that is better done via a support ticket and not this forum.
- If you are entitled to technical support then please submit a support ticket. Please do not post the same question to the forum and also via a support ticket. Once again, 2BrightSparks does not provide technical support via this forum.
.bat in 'Programs - After', but only if [Profile Name] not running
-
- Enthusiastic
- Posts: 13
- Joined: Mon Sep 06, 2010 3:20 am
-
- Enthusiastic
- Posts: 13
- Joined: Mon Sep 06, 2010 3:20 am
-
- Enthusiastic
- Posts: 13
- Joined: Mon Sep 06, 2010 3:20 am
Re: .bat in 'Programs - After', but only if [Profile Name] not running
After looking elsewhere for answers on this, we now have the following as a potential solution:
.bat 1:
.bat 2:
However I'm not entirely clear as to how exactly to implement it. If I would be better off using this as the scheduled task script that calls SBP from it? Or maybe parts of it should be run from within each SBP profile using its 'Run this before' & 'Run this after' functions?
Is anyone here able to make better sense out of this?
TIA...
.bat 1:
Code: Select all
echo job 1 > c:\temp\job1.lock
syncbackpro /dojob:1
del c:\temp\job1.lock
if not exist c:\temp\job2.lock shutdown /s /f /t 0
Code: Select all
echo job 2 > c:\temp\job2.lock
syncbackpro /dojob:2
del c:\temp\job2.lock
if not exist c:\temp\job1.lock shutdown /s /f /t 0
Is anyone here able to make better sense out of this?
TIA...
-
- Enthusiastic
- Posts: 13
- Joined: Mon Sep 06, 2010 3:20 am
Re: .bat in 'Programs - After', but only if [Profile Name] not running
The following is what I've come up with initially. I have yet to test any of it, will check back & post my findings after doing so.
SBP Job 1's Profile settings:
Run Before:
Run After:
SBP Job 2's Profile settings:
Run Before:
Run After:
SBP Job 1's Profile settings:
Run Before:
Code: Select all
touch C:\Users\Username\Locks\JobI.lock
Code: Select all
del C:\Users\Username\Locks\JobI.lock
if not exist C:\Users\Username\Locks\JobII.lock shutdown /s /f /t 0
Run Before:
Code: Select all
touch C:\Users\Username\Locks\JobII.lock
Code: Select all
del C:\Users\Username\Locks\JobII.lock
if not exist C:\Users\Username\Locks\JobI.lock shutdown /s /f /t 0
-
- Enthusiastic
- Posts: 13
- Joined: Mon Sep 06, 2010 3:20 am
Re: .bat in 'Programs - After', but only if [Profile Name] not running
Here to report that the above solution does indeed work as intended.
During a collision the first job to complete did not shut down & after the second completed it did.
Marking solved.
Just to be clear, Windows doesn't include a 'touch' command by default. I'm using 'touch.exe' from the following project on Sourceforge:
https://sourceforge.net/projects/touchforwindows/
During a collision the first job to complete did not shut down & after the second completed it did.
Marking solved.
Just to be clear, Windows doesn't include a 'touch' command by default. I'm using 'touch.exe' from the following project on Sourceforge:
https://sourceforge.net/projects/touchforwindows/
-
- Enthusiastic
- Posts: 13
- Joined: Mon Sep 06, 2010 3:20 am