forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Need to Set Environment Variables

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
camadams
Newbie


Joined: 03 Oct 2005
Posts: 2

PostPosted: Mon Oct 03, 2005 2:54 am    Post subject: Need to Set Environment Variables Reply with quote

I am launching an application from my VDS script that needs to get information from environment variables. To do this, from VDS I call a bat file that uses SET to setup the environment, then calls my app.

I want to get rid of the batch file and somehow set up the environmental variables then launch the app. But I cannot see how to do this within VDS. We are using VDS 2.2

Is this possible?
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Mon Oct 03, 2005 7:33 am    Post subject: Reply with quote

Try this:

Code:
runh cmd /c set myvar=myvalue


To get the value of an environment variable, you can use the @env() function... Smile

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
camadams
Newbie


Joined: 03 Oct 2005
Posts: 2

PostPosted: Tue Oct 04, 2005 5:40 am    Post subject: Fantastic Reply with quote

Thanks heaps for that, it works a treat. I had to extend it a bit..
Code:

%A = set myvar1=valueA
%B = set myvar2=valueB
runh cmd /c (%A & %B & myprog.exe p1=val p2=val p3=val)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group