I'm running a few different windows command scripts that all reference the same directory. The directory I want to reference changes from day to day depending on what I'm working on. I've looked into taking command line args, but I think the more elegant solution would be to have all the scripts reference some sort of config file, if such a thing is possible. Then I could change the directory address one place to change all of my standard command scripts. If it's not abundantly clear, I'm new to windows scripting.
Q: Is there a way to retrieve data from an extern开发者_开发知识库al config in a windows command script?
PS - Don't be limited by my question, if you think you have a better solution for what I'm trying to do, I'm all ears.
The simplest thing would be to use an environment variable.
eg:
set my_path=c:\foo\bar
then in the script you can use %my_path%
and it will be expanded for you.
精彩评论