Solved

Avoid killing a job in batch files

Posted on 2009-05-14
5
295 Views
Last Modified: 2012-05-07
Hello,

I've a batch file, that take a while to complete. Consists in a deletion of a directory and its files, then change of drive, and lauch a command that takes long time to accomplish its job.

@del /Q e:\Dir\subdir
@rmdir e:\Dir\subdir /s /q
@c:
@cd "C:\program files\XXX\XX"
@command.exe -h ip1 -u administrator -p password -a ipaddr:ip2 -r e:\Dir\subdir -t fullvm -M 1 > E:\Dir\log.txt

The problem, is that,  often, we accees via TS for work, and in logoff, we kill the job.

It's possible to avoid this behaviour, with a instruction in a batch file
0
Comment
Question by:zsabo
  • 3
  • 2
5 Comments
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 24388552
What if you made it part of the logoff script instead of the way you're launching it now?
0
 

Author Comment

by:zsabo
ID: 24388624
The part of script "command.exe -h ip1 -u administrator -p password -a ipaddr:ip2 -r e:\Dir\subdir -t fullvm -M 1", take more of 3-4 hours to complete. And often, we login and logoff...while the job is running.
0
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 24388658
can you make it a scheduled task on the computer rather then have it run in user context?
0
 

Author Comment

by:zsabo
ID: 24388741
Batch file launches by means of a sheduled task, that too need a user context (administrator).
0
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 500 total points
ID: 24388788
But that context will be local to the machine, not the logged in user.  You can even create a new user which will run the job locally.  The task should continue to run underneath the new user even though someone logs in.

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question