Topic "Copy/compare folder"

Author Message
Prince

Guest


Sub folder question
Hi

I have read a lot of post but I think this my request nobody ask to this forum for a possible solution.
This is my request if possible. I have this scenario:

c:\example

in this folder I have this subfolder

c:\example\carl\- 01 -
c:\example\richard\- 02 -
c:\example\helena\- 03 -
c:\example\stephan\- 02 -
c:\example\morgan\- 04 -
c:\example\mary\ - 03 -

I need to create a script for compare/copy only folder with subfolder "- 02 -"
Final result will be:

c:\example\richard\- 02 -
c:\example\stephan\- 02 -

The other folder name must be exclude

Is this possible?

Thanks for an help

Prince
Advertisements
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26705
Location: Prague, Czechia
Prince wrote:
I need to create a script for compare/copy only folder with subfolder "- 02 -"
Final result will be:

c:\example\richard\- 02 -
c:\example\stephan\- 02 -

The other folder name must be exclude

That's sound ambiguous to me.

Do you want to
- copy only folder with subfolder "- 02 -"
- or copy only the subfolder "- 02 -"

Or are these the same, i.e. is there always only one subfolder?
Guest




martin wrote:
Prince wrote:
I need to create a script for compare/copy only folder with subfolder "- 02 -"
Final result will be:

c:\example\richard\- 02 -
c:\example\stephan\- 02 -

The other folder name must be exclude

That's sound ambiguous to me.

Do you want to
- copy only folder with subfolder "- 02 -"
- or copy only the subfolder "- 02 -"

Or are these the same, i.e. is there always only one subfolder?


Need to copy folder (and file into it) with subfolder (and file into it)
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26705
Location: Prague, Czechia
There's no magic way to implement such special task.

You have to write a script that identifies the folders you are looking for.

It is easy e.g. with PowerShell and WinSCP .NET assembly.
https://winscp.net/eng/docs/library_powershell

Use:
- Session.ListDirectory to enumerate all folders
- Session.FileExists to check an existence of the - 02 - subfolder
- Session.GetFiles to download them

https://winscp.net/eng/docs/library_session_listdirectory
https://winscp.net/eng/docs/library_session_fileexists
https://winscp.net/eng/docs/library_session_getfiles
Advertisements

You can post new topics in this forum

Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License