Solved

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

Posted on 2004-08-04
3
255 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 82

Accepted Solution

by:
oBdA earned 65 total points
Comment Utility
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
Comment Utility
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
Comment Utility
<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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
In this step by step tutorial with screenshots, we will show you HOW TO: Enable SSH Remote Access on a VMware vSphere Hypervisor 6.5 (ESXi 6.5). This is important if you need to enable SSH remote access for additional troubleshooting of the ESXi hos…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 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