/build/static/layout/Breadcrumb_cap_w.png

Batch file from Source

I have to place a bunch of batch files on various servers for backup software installations. Is there a way to make the batch file run without specifying the path in each one? I've heard there's a way to do this but have been unsuccessful it finding out how.

0 Comments   [ + ] Show comments

Answers (2)

Posted by: dunnpy 17 years ago
Red Belt
0
dpolishsensation,

You can use %~DP0 to facilitate this.

%~DP0\backup.bat would replace \\server1\share1\backup.bat.

The command causes the file to be run from its relative path.

Hope this helps,

Dunnpy
Posted by: dpolishsensation 17 years ago
Blue Belt
0
Works like a charm!!! Thanks =)
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ