Copy command doesn't work

Hello

I have the following command in a button:

Find *.lnk IN "C:\ProgramData\Microsoft\Windows\Start Menu" OR "C:\Users\jose.nunes\AppData\Roaming\Microsoft\Windows\Start Menu" RECURSE=yes COLLNAME result Copy "coll://result/" TO "C:\atalhos\*" UPDATEALL

The Copy command doesn't work. If I execute the copy command alone it reports errors of the type

"An error occurred copying 'file xxx' : The filename, directoy name, or volume label syntax is incorrect (123)"

There is no problem if I copy using the find window.

"OR" isn't one of the Find command's arguments and is probably making the Find line try to search a folder named "OR" in this case.

The Find line may not be doing what you expect. If you run that line on its own and look at the "result" collection, does it contain the things you expect?

With the copy line, the wildcard is in the wrong place:

Copy "coll://result/" TO "C:\atalhos*" UPDATEALL

The wildcard should be at the end of the source, not the destination, to say you want to copy all files below the source folder directly into the destination folder:

Copy "coll://result/*" TO "C:\atalhos" UPDATEALL

I don't see wrong results in the find command , anyway how do I include two or more paths to the find command?

I tried without OR and it also works.

The correction of the copy command works if I execute it alone, included with the find command it is not executed.

Taking a step back from the command itself, what's the overall aim?

[ul][li]It looks like you want to create a flattened copy of all shortcuts in your start menu, is that correct?

[/li]
[li]Is that the end goal or an intermediate step toward making something else?

[/li]
[li]Do you want the copy to be flattened, or would you prefer it to keep the start menu's folder hierarchy?[/li][/ul]
Depending on exactly want you want to do, I think there will be a better way than using the Find & Copy combination. I was going to suggest that after getting the existing idea to work, but it might be quicker & easier to skip straight to it.

Resuming

  • I want to create a flattened copy of all shortcuts in the start menu
  • This is an intermediate step
  • And finally I want the copy to be flattened

If it's an intermediate step, what's the overall aim?

We may be able to make a script which can do the whole thing directly.

It's an intermediate step in the sense that I want to collect shortcuts to make a copy of them to a single folder.

I will be grateful if you can help making the script.

How about something like this:

[code]Go "C:\ProgramData\Microsoft\Windows\Start Menu"
Set FLATVIEW=mixednofolders,on
Select *.lnk
COPY TO C:\atalhos FLATVIEWCOPY=single UPDATEALL

Go "C:\Users\jose.nunes\AppData\Roaming\Microsoft\Windows\Start Menu"
Set FLATVIEW=mixednofolders,on
Select *.lnk
COPY TO C:\atalhos FLATVIEWCOPY=single UPDATEALL[/code]

[quote="lxp"]How about something like this:

[code]Go "C:\ProgramData\Microsoft\Windows\Start Menu"
Set FLATVIEW=mixednofolders,on
Select *.lnk
COPY TO C:\atalhos FLATVIEWCOPY=single UPDATEALL

Go "C:\Users\jose.nunes\AppData\Roaming\Microsoft\Windows\Start Menu"
Set FLATVIEW=mixednofolders,on
Select *.lnk
COPY TO C:\atalhos FLATVIEWCOPY=single UPDATEALL[/code][/quote]

Perfect! Works as I expected.