Sign in to follow this  
Followers 0
fxm

Script trying to "Copy to folder..." fails in Win7 [only]

7 posts in this topic

I am dynamically selecting files to copy.

These steps

ControlListView() ; open the source folder

Send() ; activate "Copy to folder..." selection

work in WinME through Win7.

The next step

ControlTreeView() ; select the target folder.

fails in Win7 only.

The problem is that the desired target folder [a Network Place] does not appear in the TreeView in Win7. In the other OSes it does appear in the structure, albeit at an OS-dependent location.

Is there a way in Win7 to have a Network Place appear in the "Copy items" SysTreeView32? Or do I need to code a work-around in Autoit?

Share this post


Link to post
Share on other sites



Why are you doing clunky automation of the Windows GUI? Why not just use FileCopy() and/or DirCopy() and do it for yourself?

:huh2:


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

Share this post


Link to post
Share on other sites

I have tried copying files to a remote file share and have also had trouble. I haven't figured out how to do it directly through FileCopy or DirCopy as PSaltyDS recommended. My workaround has been mounting the share folder to a drive letter with DriveMapAdd (I usually use the B: drive since it's never used). Copy the files to the destination - example: ("B:\Destination"). The use DriveMapDel to remove the mapped drive.


#include <ByteMe.au3>

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Why are you doing clunky automation of the Windows GUI? Why not just use FileCopy() and/or DirCopy() and do it for yourself?

Mostly because I started by automating a manual process :huh2:

Plus, I don't look forward to giving up pattern matching either in ControlListView [which makes it easy to select varying numbers of files with dynamically chosen names] or in ControlTreeView [which makes it easy to validate/navigate target-installation-dependent folder structures].

Besides, I still need some way to locate the target folder name on Win7 systems.

That being said, FileCopy() is Plan B.

Edited by fxm

Share this post


Link to post
Share on other sites

I have tried copying files to a remote file share and have also had trouble. I haven't figured out how to do it directly through FileCopy or DirCopy as PSaltyDS recommended. My workaround has been mounting the share folder to a drive letter with DriveMapAdd (I usually use the B: drive since it's never used). Copy the files to the destination - example: ("B:\Destination"). The use DriveMapDel to remove the mapped drive.

I will look into that.

I hadn't considered that solution because my first attempts on Win7 with "net use ^ path..." [which is, I assume, the underlying function] failed when the target was a webDAV folder or the path contained [at least some] special characters.

Share this post


Link to post
Share on other sites

Just as added info here

I was in a discussion the other day with someone who was attempting file copy proceedure so a UNC path and it failed. If it was to a mapped drive of course it worked.

The answer was to add the share name to the path.

\\Server\some\path\ would fail however \\Server\ShareName\Some\Path\ worked fine.

I don't know if it will help you out or not but it is something to keep in mind.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

The answer was to add the share name to the path.

\\Server\some\path\ would fail however \\Server\ShareName\Some\Path\ worked fine.

It isn't immediately clear [to me, anyway] how to convert the address of a webDAV folder [e.g., http://home.comcast.net/~username] or an ftp [possibly virtual] folder [e.g., ftp://username@upload.comcast.net] to UNC form.

I appreciate any pointers or help but I realize that this may be getting somewhat off-topic for this forum.

Edited by fxm

Share this post


Link to post
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
Sign in to follow this  
Followers 0