|
TheHardCount Newbie
Joined: 06 Aug 2007 Posts: 5 Location: Las Vegas, Nevada
|
Posted: 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? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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). |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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.
|
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: 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." |
|
|
|
|
|