robertmoody151 Posted July 14, 2010 Share Posted July 14, 2010 Hi, Does anyone know of a way to use either system variables or hard coded constants to generate file names. What I am trying to do is to copy some information from a PC and then rename the file based upon the above criteria. I have my script collecting the data and writing it to a file but I don't have the renaming part correct. Any thoughts or ideas would be helpful. Link to comment Share on other sites More sharing options...
trancexx Posted July 14, 2010 Share Posted July 14, 2010 What exactly is the problem? $sOldName = @ScriptFullPath $sNewName = @ScriptFullPath & "_new.au3" FileMove($sOldName, $sNewName, 8) ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
robertmoody151 Posted July 15, 2010 Author Share Posted July 15, 2010 What exactly is the problem? $sOldName = @ScriptFullPath $sNewName = @ScriptFullPath & "_new.au3" FileMove($sOldName, $sNewName, 8) Link to comment Share on other sites More sharing options...
robertmoody151 Posted July 15, 2010 Author Share Posted July 15, 2010 I am creating a file called data.rdm. I want to take a constant such as a "99" + the file name + the current date and rename the file so that data.rdm now looks like 99data071510.rdm. I am very new to this so I am not sure how to get this done in a single pass, if possible. I've written my first project and all parts of the project works fine, this is a new feature that will help identify the source and I don't know how to get this done. Your help and comments are appreciated. Link to comment Share on other sites More sharing options...
Kaeft Posted July 15, 2010 Share Posted July 15, 2010 (edited) $sNewName = $number & $oldfilename & $date & $extension $number = 99 $oldfilename = "data" $date = 071510 $Extension = ".rdm" you could get really fancy and make the date get the actual date. $date = @MDAY & @MON & @YEAR Throw in a while to make your $number count up or down. Edited July 15, 2010 by Kaeft Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now