Solved

Avoid killing a job in batch files

Posted on 2009-05-14
5
294 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now