batch library usage / methodology question.

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
mirrormirror
Posts: 129
Joined: 08 Feb 2016 20:25

batch library usage / methodology question.

#1 Post by mirrormirror » 28 Jul 2016 16:40

How do you guys handle your libraries of functions/macros/utilities? A couple of the types of things I'm looking for are:

1. How do you deal with updating shared macros/functions, etc. when your existing scripts (which rely on these) are working perfectly fine - when updating the shared code can risk breaking an existing dependency.

- I've thought about keeping different versions of shared code but that seems like overkill for what I do.

2. How do you deal with running your scripts on machines that are not your "main" machine - which don't have all of your utilities in your path?

Often, I like to test things out within a VM which doesn't have all of the code needed. For this issue I've experimented with encoding some utilities within my script and extracting them if needed but I can see how this could become a maintenence nightmare.

Anyway, I'm just looking for ideas on how others deal with things like this...

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: batch library usage / methodology question.

#2 Post by penpen » 29 Jul 2016 11:07

Ad 1) http://www.dostips.com/forum/viewtopic.php?p=46726#p46726

Ad 2) I only place my batches on "my main machine" (aka "the server").
I access the files from a virtual virtual drive (subst.exe X: "\\server\foo\X"),
so the directory structure is always the same, and my "collection" is always complete.


penpen

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: batch library usage / methodology question.

#3 Post by foxidrive » 30 Jul 2016 02:24

In the long term I've come avoid sharing macros/functions and your comment is the reason - because code breaks and I can't test every script again.

Every script I have is self-contained and reliable, and the only shared script is one that returns the date-time in a format that I use everywhere.

mirrormirror wrote:2. How do you deal with running your scripts on machines which don't have all of your utilities in your path?


One way to handle that is to put them all on a usb stick and then have your scripts call a shared script.
That script searches for a known file on all drive letters and adds that drive to the PATH.

You may be referring to applications rather than what I term as utilities, but USB sticks are massive and fairly quick these days and in a pinch even big apps can work ok.

Post Reply