Script to dirs delete on multiple computers

Hello,

I have 5 similar machines, with similar directory structures. an example:

\nvc0048\c$\Agilent3070\boards\5063442
\nl7c0015\c$\Agilent3070\boards\5063442

What I want to do is the following: I want to select the first dir "\nvc0048\c$\Agilent3070\boards\5063442" and delete this dir "5063442". And at the same time i want to delete it on the other machine. I guess i have to work with substring or someting.

Who can give me some hints, examples?

Will you always be at the same level or will the number (and/or name) of the parent paths vary?

If it varies, you're probably best off having Opus pass the path to a VBScript (or Perl or whatever floats your boat) script and having it do the rest.

If it is always the same then it probably won't require a script. Depends on that, though.

This will alwys be the same:
\xxxxxx\c$\Agilent3070\boards\yyyyyy
xxxx: computer
yyyy:wil vary

Can I do this way:
@runonce:Delete "pc1\c$\Agilent3070\boards{filepathshort}*"
@runonce:Delete "pc2\c$\Agilent3070\boards{filepathshort}*"
@runonce:Delete "pc3\c$\Agilent3070\boards{filepathshort}*"
@runonce:Delete "pc4\c$\Agilent3070\boards{filepathshort}*"
@runonce:Delete "pc5\c$\Agilent3070\boards{filepathshort}*"

I noticed that {filepathshort} is not the correct one. If i can find a command wich only returns the foldername yyyy i all set. But i dont know if there is such command..

{file$} returns just the name.

(The $ at the end means the command won't do anything if no file is selected. You definitely want that if you are deleting things, else if you click the button by mistake it could delete all the folders.)

PS: There shouldn't be any need for @runonce: to be used with the commands (although it shouldn't hurt, either).

PPS: Since you're putting the quotes in manually, you should add @nofilenamequoting to the command to stop extra quotes being inserted into the {file$} parts when they contain spaces. So something like this:

@nofilenamequoting Delete "\\pc1\c$\Agilent3070\boards\{file$}\*" Delete "\\pc2\c$\Agilent3070\boards\{file$}\*" Delete "\\pc3\c$\Agilent3070\boards\{file$}\*" Delete "\\pc4\c$\Agilent3070\boards\{file$}\*" Delete "\\pc5\c$\Agilent3070\boards\{file$}\*"

Also, that will delete the contents of the folders but not the folders themselves. If you want the folders themselves to be deleted then you shouldn't add the * to the ends of the paths:

@nofilenamequoting Delete "\\pc1\c$\Agilent3070\boards\{file$}" Delete "\\pc2\c$\Agilent3070\boards\{file$}" Delete "\\pc3\c$\Agilent3070\boards\{file$}" Delete "\\pc4\c$\Agilent3070\boards\{file$}" Delete "\\pc5\c$\Agilent3070\boards\{file$}"

Thx it works. I would have never tried {file$} because i wanted a folder ..., but then again a folder is a file :slight_smile: