neo van matix Posted April 27, 2007 Share Posted April 27, 2007 Hi there, i try to cleanup the startmenu on some workstations. So i wrote a little script, but it doesnt work: $oracle_folder = "C:\Dokumente und Einstellungen\All Users\Startmenü\Programme\oratemp" IF NOT FileExists($oracle_folder) THEN DirCreate($oracle_folder) $ora = "C:\Dokumente und Einstellungen\All Users\Startmenü\Programme\Oracle*" DirMove($ora, $oracle_folder&"\*", 1) Okay, you see.. it should copy all Dirs in the Startmenu which begins with "Oracle" move to a new dir "oratemp". The script creates the new folder, but doesnt copy the Oracle-Folders. I created 3-4 emtpy dirs for testing ("Oracle asdf", "Oracle 9999", "oracle d"). I know, that the wildcard is working - i've a second script, that moves some Microsoft-Office Shortcuts in the Startmenu to another folder... and thats working :/ Ive got only problems with the folder-handling :/ Some Ideas? Attention! English noob ^^ Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 27, 2007 Share Posted April 27, 2007 I don't think DirCopy() or DirMove() accept wild cards. Read the help file on _FileListToArray(), using the flag to list directories only, then walk through the array and move them one at a time. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Gabburd Posted April 27, 2007 Share Posted April 27, 2007 Try this: #include <file.au3> $oracle_folder = "C:\Dokumente und Einstellungen\All Users\Startmenü\Programme\oratemp" IF NOT FileExists($oracle_folder) THEN DirCreate($oracle_folder) $ora = "C:\Dokumente und Einstellungen\All Users\Startmenü\Programme" $FoldersToMove = "Oracle*" $FolderArray = _FileListToArray( $ora, $FoldersToMove, 2) For $i = 1 To $FolderArray[0] DirMove($ora & "\" & $FolderArray[$i], $oracle_folder & "\" & $FolderArray[$i], 1) Next Link to comment Share on other sites More sharing options...
neo van matix Posted May 2, 2007 Author Share Posted May 2, 2007 Thanks guy's, works fine! Attention! English noob ^^ 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