Solved

Avoid killing a job in batch files

Posted on 2009-05-14
5
299 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

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 …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

688 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