Solved

CD in a batch script called by the at task scheduler?

Posted on 2004-08-04
3
257 Views
Last Modified: 2010-04-13
Hi!

I got some problems with a batch script I wrote.
The intent is to backup a few files.
So Im trying to cd to a directory, zip it (my zip app requires to go to the parent directory), and copy it to a "secure" place.

So, when I start it manually, everything works fine.
Where from I start the batch script does not matter.

But when I create a task to run it every day, the script fails.
I have narrowed the problem down to the task no accepting cd commands in a batch script.

So why is that so, and how can I work around that?

Regards,
Marko

PS: Im bound to use that zip app...
0
Comment
Question by:karlika
3 Comments
 
LVL 83

Accepted Solution

by:
oBdA earned 65 total points
ID: 11713731
You can happily change paths in a scheduled script. Main question: where does your data reside that you want to zip, and where do you want to save it?
0
 
LVL 1

Assisted Solution

by:Tezdread
Tezdread earned 60 total points
ID: 11714287
Might not be relevant but what zip software are you using?

You might want to add the SET command to your batch file...something
like: SET OriginalDir=c:\your_directory
then instead of: CD c:\your_directory you'd add CD %OriginalDir%

That might sort it out.
0
 
LVL 2

Author Comment

by:karlika
ID: 11714589
<banging head against monitor/>

Mixing scripting for different OSes is seldom working ;)
I just forgot that Windows doesnt like it when you try to cd from one drive to another in one step ...

Oke, thanks for your postings.

Regards,
marko
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

777 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