Jump to content

file copy *.* skipping some files


gcue
 Share

Recommended Posts

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 by gcue
Link to comment
Share on other sites

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_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: 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 Program

AutoIt_Icon_small.pngUDFs: 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
 
AutoIt_Icon_small.pngExamples: 
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 AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

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)
Link to comment
Share on other sites

ok guess that will have to do

i 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 by weaponx
Link to comment
Share on other sites

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

*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 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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...