jbsoccerbrit Posted May 24, 2010 Share Posted May 24, 2010 (edited) I know the below is not correct but hopefully it gives the general idea of what I am wanting to do. RunWait(@COMSPEC & " /cd $location rename *.$fileextension *.$newextensionname") so in the command window it would perform a CD command to change current dir (press enter) the pull in the vars for the current extension and the extension to be renamed to. Edited May 24, 2010 by jbsoccerbrit Link to comment Share on other sites More sharing options...
taietel Posted May 24, 2010 Share Posted May 24, 2010 I have not tried, but you should write your command like this: RunWait(@COMSPEC & " /cd " & $location & " rename *." & $fileextension & " *." & $newextensionname) Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
jbsoccerbrit Posted May 24, 2010 Author Share Posted May 24, 2010 C:\Documents and Settings\****\Desktop\test.au3(62,1) : ERROR: syntax error ( ^ C:\Documents and Settings\****\Desktop\test.au3(62,82) : ERROR: syntax error (@COMSPEC & " /cd " & $someText2 & " rename *." & $someText1 & " *." & $someText3) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\****\Desktop\test.au3 - 2 error(s), 0 warning(s) Link to comment Share on other sites More sharing options...
taietel Posted May 24, 2010 Share Posted May 24, 2010 (edited) RunWait(@COMSPEC & ' /c ' & 'rename "' & $location & "*." & $fileextension & '"' & " *." & $newextensionname, "",@SW_HIDE) [edit] This one I've tested! If you have spaces in the directory name, you have to enclose that: "bla bla" or 'bla bla' Edited May 24, 2010 by taietel Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
jbsoccerbrit Posted May 24, 2010 Author Share Posted May 24, 2010 Is there anyway to make the location change first so its cd $location and then the rename folders suit? I.E CD $location rename *.ext1 *.ext2 Otherwise I dont think it will work thank you kindly for the help Link to comment Share on other sites More sharing options...
taietel Posted May 24, 2010 Share Posted May 24, 2010 Here is another working example (change it to your needs): $location = "tempx" $fileextension = "chm" $newextensionname = "mih" RunWait(@COMSPEC & ' /c ' & 'cd "' & $location & '"',"",@SW_HIDE) RunWait(@COMSPEC & " /c " & "rename *." & $fileextension & " *." & $newextensionname, $location,@SW_HIDE) Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
jbsoccerbrit Posted May 24, 2010 Author Share Posted May 24, 2010 unfortunately the two runwaits would have to be merged into one line otherwise once the CD (Change Directory) is done and closes the rename isn't applied to anything. I've tried filemove and it just seems to delete the file... at a loss with this. Link to comment Share on other sites More sharing options...
taietel Posted May 24, 2010 Share Posted May 24, 2010 (edited) I've merged it in one line (I've tested it - working!): RunWait(@COMSPEC & " /c " & "cd '" & $location & "' & rename *." & $fileextension & " *." & $newextensionname, $location,@SW_HIDE) [edit] Why did you use filemove? Edited May 24, 2010 by taietel Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
jbsoccerbrit Posted May 24, 2010 Author Share Posted May 24, 2010 It was a suggestion from someone else to try, based on them recalling that autoit didn't have its own rename feature. Thanks again for all the help 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