KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

SHELL "%COMSPEC% /C FOR /F --- rename file to date HELP

 
Post new topic   Reply to topic    KiXforms Forum Index -> Advanced Scripting
View previous topic :: View next topic  
Author Message
MChokrach1
KiXforms Novice
KiXforms Novice


Joined: 26 Jul 2007
Posts: 1

PostPosted: Thu Jul 26, 2007 6:28 pm    Post subject: SHELL "%COMSPEC% /C FOR /F --- rename file to date HELP Reply with quote

Im currently working on a script that will rename a log file to include "today's" date. In DOS the process is fairly straight forward, I simply include the following lines in my batch script and viola!:

FOR /F "tokens=2,3,4 delims=/ " %%I in ('DATE /T') DO SET date1=%%I%%J%%K
RENAME C:\KeyMon\KeyMonLog\KeyMon.log KeyMon_%date1%.log

The resulting file would be called: KeyMon_07222007.log

I am trying to do the same thing within KIX but so far I have had no luck.
I'm attempting to use the following Shell Command, but I keep getting errors (see below)

SHELL '%COMSPEC% /C FOR /F "tokens=2,3,4 delims=/ " %%I in ('DATE /T') DO SET date1=%%I%%J%%K' | 'RENAME C:\KeyMon\KeyMonLog\KeyMon.log KeyMon_%date1%.log'

ERROR
Unknown or unexpected command [DATE]

Can someone help point me in the right direction? I want to achieve this without having to call another script to keep administration to a minimum.

Any help you can provide will be greatly appreciated.
Back to top
View user's profile Send private message
Les
KiXforms Aficionado
KiXforms Aficionado


Joined: 24 Dec 2003
Posts: 317

PostPosted: Thu Jul 26, 2007 7:09 pm    Post subject: Reply with quote

This forum is for KiXforms, a GUI addon to KiX. KiX questions unrelated to forms should be directed to www.kixtart.org instead.
_________________
The Repro Man
Stealing for a living!
Back to top
View user's profile Send private message
Gargoyle
KiXforms Aficionado
KiXforms Aficionado


Joined: 30 Dec 2003
Posts: 366
Location: Arizona

PostPosted: Fri Jul 27, 2007 6:13 am    Post subject: Reply with quote

In the meantime you can read up on the Macro @DATE and the use of SPLIT and JOIN

http://www.kixtart.org/manual

_________________
Parents were invented to make children happy by giving them something to ignore.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Advanced Scripting 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 cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group