Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Set Environment Variable From CMD Prompt

 
James Ellis
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For various reasons I need to be able to set an environment variable from DOS and have that value still be present when the machine is rebooted. Using the "SET" command the value is only valid for the open DOS window. Anyone know how to do this?

PS - I know about Control Panel/System/Advanced Tab...I need to do it through DOS/CMD Prompt.

Thanks,
Jim
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Windows used to use a file called 'autoexec.bat' for setting environment variables. They stopped shipping it in newer versions but I think the OS still looks for it and runs it, if it's there.

I believe it looks in 'c:\'
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see why you couldn't put your own batch file in the startup folder either...


If you get it working, report back with you you did it.
 
James Ellis
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe the way I'm going to handle it is to try and set these variables through the InstallAnywhere script that will install the program. I'll let everyone know if I think of another way to do this.

Thanks,
Jim
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic