DOS/.CMD Environment Variables
From: StephenMcC (StephenMcC_at_discussions.microsoft.com)
Date: 06/15/04
- Next message: Ian Tough: "Creating a desktop icon"
- Previous message: Michael Harris \(MVP\): "Re: Error when selectiong a file with BrowseForFolder"
- Next in thread: Tom Lavedas: "RE: DOS/.CMD Environment Variables"
- Reply: Tom Lavedas: "RE: DOS/.CMD Environment Variables"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 15 Jun 2004 02:03:01 -0700
Hi all,
I'm having trouble getting access to envionment variables in DOS (.cmd files). I'm running scripts on a web server which download a file containing password information which I add to the SYSTEM environment object for the life of the scripts and then when I'm done I remove these.
My problem is that I can't get access to these in the same process within the DOS/.cmd script, if I terminate the script after these are added and run it again then the DOS script can read the Env variables.
Is there any way to force the DOS/.cmd script to read the Env variables in the same session/process that they were added, rather than having to use .vbs which is what I'm using at the moment via the WScript Env object.
Ideally I'd like to first call a .vbs file to download the file, process it and add the password info and then access these from the DOS scripts ie:
ECHO My AUDIT PASSWORD Env Var=%ENV_AUDIT_PASS%
'ENV_AUDIT_PASS' being the name for the Env variable added to the SYSTEM Env Collection obj.
I've tried using SETLOCAL etc which some people suggested with no joy.
Any ideas, anyone ??
Cheers,
Stephen
.
- Next message: Ian Tough: "Creating a desktop icon"
- Previous message: Michael Harris \(MVP\): "Re: Error when selectiong a file with BrowseForFolder"
- Next in thread: Tom Lavedas: "RE: DOS/.CMD Environment Variables"
- Reply: Tom Lavedas: "RE: DOS/.CMD Environment Variables"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|