hi 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 FileMove($Read, $Read & "\" & $STR & "\" & $STR & ".xlsx") EndIf next I have 3 folders under "C:\New folder (3)" and I have 5 excel files:
C:\New folder (3)\1
C:\New folder (3)\3
C:\New folder (3)\5
1.xlsx (value of column A are all 1)
2.xlsx (value of column A are all 2)
3.xlsx (value of column A are all 3)
4.xlsx (value of column A are all 4)
5.xlsx (value of column A are all 5)
I run the above script and those excel file 1, 3, 5 was transfered in the 1, 3, and 5 folders but the value of transfered file in Column A are different and file no. 4 and 5 still remains in the folder "C:\New folder (3)".... ???
whats wrong with the script???
I 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) For $Index = 1 To $Files If StringRight($Files[$Index],4) <> ".ini, MyDesktop.lnk" Then FileMove($Files[$Index],'F:\HOME\Desktop') EndIf Next
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 ^__^
from the DirMove page we have:
I'm facing exactly the same issue and I need a simplest way to fix it. Could somebody take look at this code:
Func _Extract_MoveMod($p_Dir) Local $Success=0 $Files=_FileSearch($g_GameDir & '\' & $p_Dir, '*') For $f=1 to $Files If StringInStr(FileGetAttrib($g_GameDir & '\' & $p_Dir & '\' & $Files[$f]), "D") Then $Success = DirMove($g_GameDir & '\' & $p_Dir & '\' & $Files[$f], $g_GameDir, 1) Else $Success = FileMove($g_GameDir & '\' & $p_Dir & '\' & $Files[$f], $g_GameDir & '\', 1) EndIf If $Success = 0 Then Return 0 Next $Success = DirRemove($g_GameDir & '\' & $p_Dir, 1) Return $Success EndFunc ;==>_Extract_MoveMod and tell me how I can fix this inside that function?
P.S. Why DirMove act such way is beyond my reason, especially as default and there is no flag to change it.
I want to move the content of D:\downloads to D:\pictures in my program. I found DirMove, but that causes problems...
Func Move($dest) DirMove("D:\downloads\", "D:\pictures\ABC\" & $dest) DirCreate("D:\downloads") EndFunc In a prior program exactly this piece of code did the job always properly, but now not anymore. The source path stays untouched, and a destination folder is created but empty.
I don't have a clue why it doesn't work anymore now. I've checked it dozens of times, read the article about DirMove, tried it with dozens of different combinations, but none lead to the result. I want the content of D:\downloads in D:\pictures\ABC without having another downloads folder within the destination folder or anything else... Thanks!
D:\downloads\cute_kitten.jpg should be D:\pictures\ABC\cute_kitten.jpg afterwards.