Windows 7
I have many scripts wrappers (.exe) that were written for XP. Many have hard paths like c:\winnt or c:\documents and settings...
How should I create a script that will work for both OS version? Are there any examples out there?
Thanks
Nubie
How should I create a script that will work for both OS version? Are there any examples out there?
Thanks
Nubie
0 Comments
[ + ] Show comments
Answers (5)
Please log in to answer
Posted by:
airwolf
14 years ago
Posted by:
Jsaylor
14 years ago
Posted by:
airwolf
14 years ago
Well, if he's sending things to c:\winnt in an XP environment, he probably doesn't actually want them to go to %windir%.
Well, I was giving an example in AutoIt. There are several variables for finding different types of directories (such as Documents and Settings in XP vs. Users in Vista/7).
My point is we can't help him until he tells us the language his scripts are written in.
Posted by:
Jsaylor
14 years ago
The answer is pretty much the same no matter what language he's going to be writing in, unless you just want to hand over a boxed answer. Our fine feathered friend here probably isn't aware of the base concept behind it, so that's where we should start.
That answer is: Use environment variables.
Every language has a different interface for how you get to those environment variables, but those are what you're looking for. Andy is correct in that no one can give you a snippet of code to shoehorn into your scripts without knowing what language it's in, but the concept of environment variables is the same regardless of exactly how they're typed in.
That answer is: Use environment variables.
Every language has a different interface for how you get to those environment variables, but those are what you're looking for. Andy is correct in that no one can give you a snippet of code to shoehorn into your scripts without knowing what language it's in, but the concept of environment variables is the same regardless of exactly how they're typed in.
Posted by:
mtaff
14 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.