gcue Posted December 3, 2008 Share Posted December 3, 2008 (edited) i am trying to copy from a subdir to a parentdir FileCopy(@ScriptDir & "\Dir\*.*", @ScriptDir, 1) it copies all the files over just fine except these: _psexec.exe vnc_viewer.exe uptime.exe is it possible that it fails once it sees the "_" so it stops copying everything else after that? what syntax should i use that should guarantee all files are copied over... (none of the files are in use by the way). thanks Edited December 3, 2008 by gcue Link to comment Share on other sites More sharing options...
FireFox Posted December 3, 2008 Share Posted December 3, 2008 Hi, you should go to this way : -list files in directory (filefindfirstfile) -try to search in your file when copying with string functions if _ exists (stringinstr;stringregexpreplace) Link to comment Share on other sites More sharing options...
gcue Posted December 3, 2008 Author Share Posted December 3, 2008 hmmm that seems more work than it should be Link to comment Share on other sites More sharing options...
MrCreatoR Posted December 3, 2008 Share Posted December 3, 2008 Have you tried to copy them seperatly? FileCopy(@ScriptDir & "\Dir\_psexec.exe", @ScriptDir, 1) etc. Just to see if it's copying like this. Or try to copy them manualy. Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
gcue Posted December 4, 2008 Author Share Posted December 4, 2008 ya i tried that-worked weird huh? so it seems that the *.* isnt working correctly with the filecopy udf? =/ Link to comment Share on other sites More sharing options...
KaFu Posted December 4, 2008 Share Posted December 4, 2008 hmmm that seems more work than it should be Not really... Copy&Paste from help... 60 seconds later... $search = FileFindFirstFile(@scriptdir & "\dir\*.*") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop filecopy(@scriptdir & "\dir\" & $file,@scriptdir) WEnd ; Close the search handle FileClose($search) OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
gcue Posted December 4, 2008 Author Share Posted December 4, 2008 ok guess that will have to do i still think its weird that the *.* didnt work. =/ Link to comment Share on other sites More sharing options...
weaponx Posted December 4, 2008 Share Posted December 4, 2008 (edited) ok guess that will have to doi still think its weird that the *.* didnt work. =/It works just fine. Perhaps those files are running and maybe locked from being read. Maybe their ACL is hosed.Do a better test. Create a folder Old and New, in "Old" create a new file called _TEST.txt and T_E_S_T.txt.FileCopy(@ScriptDir & "\Old\*.*", @ScriptDir & "\New")If they copy okay then there is something going on with your files. Edited December 4, 2008 by weaponx Link to comment Share on other sites More sharing options...
Nahuel Posted December 4, 2008 Share Posted December 4, 2008 Another thing I'd suggest, is you copying those files manually to a new folder named TEST, for example. Create an empty folder called DEST and try to copy FileCopy(@ScriptDir & "\TEST\*.*", @ScriptDir & "\DEST") Link to comment Share on other sites More sharing options...
system24 Posted December 5, 2008 Share Posted December 5, 2008 (edited) *original post content deleted* Now I understand. I hate it when I go wrong. Look at its attributes. FileCopy() can't copy files with some specific attributes. Edited December 6, 2008 by system24 [center]It's a question of mind over matter, if I don't mind, it doesn't matter.[/center] Link to comment Share on other sites More sharing options...
weaponx Posted December 5, 2008 Share Posted December 5, 2008 Hope this works.I think you misread the topic. The code you posted purposefully skips the files he NEEDS to be copied over. Link to comment Share on other sites More sharing options...
Tlem Posted December 5, 2008 Share Posted December 5, 2008 Hello. I create the same structure that you explain (3 exe files whith specific name). And I create the same script that you present. The filecopy work fine on my PC. Maybe the files are locked, or the script haven't the right to copy the files. Best Regards.Thierry 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