Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
TheHardCount
Newbie


Joined: 06 Aug 2007
Posts: 5
Location: Las Vegas, Nevada

PostPosted: Tue Oct 23, 2007 4:07 am   

Windows Environment Variables
 
Hello,

I am trying to set up logging in a somewhat fancy way. Here is the command I am trying to use:

Code:
#LOG %concat("%USERPROFILE%\My Documents\CMUD\", %exec(#CHAR), "\Logs\",%time(yyyy.mm.dd),".txt")


The problem seems to be with the %USERPROFILE% Windows environment variable. Does anyone know a way to do this?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue Oct 23, 2007 4:45 am   
 
As far s I'm aware, you can't us dyanamic directories like this. However, CMUD's data directory's automatically created in My Documents\My Games and you can move it into My Documents itself easily enough if you like. If you don't specify a drive, that's where the logs are created.

Also, you should use %ch instead of %exec(#ch).
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Oct 23, 2007 5:41 am   
 
Yeah, CMUD doesn't expand Windows environment variables, although that's a good suggestion for a future CMUD function call.
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Sat Nov 03, 2007 10:58 am   
 
#var Shell %comcreate("WScript.Shell")
#echo @Shell.ExpandEnvironmentStrings("%USERPROFILE%")
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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

© 2009 Zugg Software. Hosted by Wolfpaw.net