[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Avoid killing a job in batch files

Posted on 2009-05-14
5
Medium Priority
?
301 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 41

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 41

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 41

Accepted Solution

by:
Kyle Abrahams earned 1500 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

650 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