Search the Community
Showing results for tags 'filemove'.
Found 9 results
Confused by FileMove (Rename)
MFrancisca posted a topic in AutoIt General Help and SupportHello everyone, I'm trying to make a script that renames a file. I'm using FileMove but I'm really confused. The name change is on the EXTENSION, not on the file name itself. I need to change it from ".exe_" to "exe". FileMove is returning a 0 value and the file is clearly not renamed. Here is the relevant code. For $index = 1 to (UBound($file_array) - 1) $new_file_name = StringTrimRight($file_array[$index], 1) FileMove($dir & "\" & $file_array[$index], $dir & "\" & $new_file_name) Next some context notes: $file_array
232showtime posted a topic in AutoIt General Help and Supporthi im stuck with this I want to transfer the correct file in the existing folder #include <File.au3> #include <AutoItConstants.au3> #include <Array.au3> $Read = "C:\New folder (3)" $FLFiles1 = _FileListToArrayRec($Read, "*.xlsx", $FLTAR_FILES, $FLTAR_NORECUR, $FLTAR_SORT, $FLTAR_NOPATH) _ArrayDisplay($FLFiles1) For $i = 0 To UBound($FLFiles1) - 1 $STR = StringTrimRight($FLFiles1[$i], 5) ConsoleWrite($STR & @CRLF) $dirS = DirGetSize($Read & "\" & $STR) If $dirS = -1 Then MsgBox(16, $STR, $dirS) Else FileMov
Cleanup User Desktop
copyleft posted a topic in AutoIt General Help and SupportI am trying to create a script to clean up users' desktops by moving all desktop folders and files (except the two hidden "desktop.ini" files and a MyDesktop.lnk shortcut) to a different folder. The script below will move files but not folders. The other issue with the script is that it doesn't seem to execute from a location other than the user's desktop. I would appreciate any suggestions. #include <File.au3> MsgBox(64, "Desktop", "Cleaning up Desktop. This box will close in 4 seconds.", 4) $Files = _FileListToArray(@DesktopDir,"*",1)
FileMove for Renaming Purposes
XinYoung posted a topic in AutoIt General Help and SupportHello again, I'm trying to use the FileMove function to rename a bunch of text files. Some of the files have "_1" at the end of their name, for example, "File123_1.txt". I want to remove the "_1" so it would become "File123.txt". What I currently have... FileMove($sSource & "\*_1.txt", $sDestination & "\*.txt") But since I'm using a wildcard, it doesn't appear to be working. I think it's just replacing .txt with .txt. Am I going about this the wrong way? How can I use wildcards and still accomplish this? Any help is greatly appreciated ^__^
Renaming of files
climmax posted a topic in AutoIt General Help and SupportHi all, As a newby i need some help. I am trying to add time stamps to file names. But it has to do it only once. So i made a check on lenght of filename. If filename extention and Lenght is correct it renames the file with a time stamp. I use a ini file for settings. and extentions what needs to be renamed. The script works but only once. it renames all the files that are in the ini . like test.txt to text050102.txt But when there is 2 files. Like test.txt and text050102.txt It does not rename the test.txt file where am i doing this wrong? #include <Array.au3> #include <File.
Hi All, I'm making a stage 1 preparation script to apply to target worksation Win 7 and Win 8.1 machines -in preparation to running a separate batch script later (stage 2) within our Windows Server with "netdom.exe move" xxxxxxxx Stage 1 Script Tasks: 1. delete some common shortcuts 2. Then move all files within common user profile backup locations - including any files in the sub-directories of the common backups locations within each users profile folder. Stage 1 Script Purpose: Make it easy for staff to grab files and folders from one C:\_Backup directory Stage 1 Script PROBLEM: The sc
Need help using MoveDir with a varible
owensct posted a topic in AutoIt General Help and SupportHi All, I've got a head scratcher that I am hoping someone could help me with as I'm trying to finsih up some code for our HR department that I need to put into production by Monday morning. I have written a Autoit script that shuts down a database engine and then does a copy of the database to a folder on the database server. Unfortunately the backup space on the server is limited so I have been manually moving the backups to another server twice a week until I could find the time to automate the move of the files and folders as part of the script. Well the time to automate it is this w
Hi! It took me an hour to find out, that FileMove() doesn't work in _Example1(). But what's the reason? #Include <GDIPlus.au3> $sSource = 'C:\Wallpaper\AnyImage.jpg' $sDest = 'C:\Wallpaper\16_10\AnyImage.jpg' _Example1() ;~ _Example2() Func _Example1() _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile($sSource) _GDIPlus_ShutDown() FileMove($sSource, $sDest, 1 + 8) EndFunc Func _Example2() FileMove($sSource, $sDest, 1 + 8) EndFunc I wrote a small script to sort wallpapers by their aspect ratio (16:10, 16:9, 4:3, ...), but it doesn't work, because FileMove() doesn
[RESOLVED] Send to FileMove?
johnmcloud posted a topic in AutoIt General Help and SupportThe FileMove command is simple FileMove("C:Test", "D:Test") But if i want to use it with different dir, for example put it in "SendTo" dir? Like a script .bat. So the first dir change, and the second is always the same. It's possible? Thanks