topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday November 11, 2025, 7:17 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Recent Posts

Pages: prev1 ... 18 19 20 21 22 [23] 24 25 26 27 28 ... 225next
551
Post New Requests Here / Re: Folder Organizer/Sorter
« Last post by 4wd on January 14, 2019, 06:24 PM »
He didn't seem to mean the files being in the directory, which was why I was asking.

... scan for files with a specific extension in/out of a compressed folder ...

I took it to mean files within the directory and archives.
552
OK, so if I've got this right, maybe, the full path is split into two parts only to be acted upon:

  • \test\test2\One\two\three\ozorroee\
  • ofile.text

?

Starting with the current version, more or less.

With -dr, the whole path is seen as one string (with or without the file's extension  ;)), regex_replace() is applied to it.
Without -d, only the second part (= the file name, with or without the file's extension  ;)) will be processed.

(Stop modifying your postings while I reply to them.  :mad: :-[)

OK, now it makes sense ... was completely at odds with every other rename program I've used  ;D
553
Surprise me:

Surprise!

2019-01-15 10_24_57-K__test.png

remv -sdrvv "o(.+)e(.+)" d$1$2 test
2019-01-15 10_27_21-K__test.png


remv -sdrvv "o(?:.+)e(.+)" d$1$2 test
Code: Text [Select]
  1. K:\>remv -sdrvv "o(?:.+)e(.+)" d$1$2 test
  2.  Renaming           'test\test2\One\two\three\ozorroee\ofile.txt' to 'test\test2\One\twd.txt' ...
  3. Successfully renamed test\test2\One\two\three\ozorroee\ofile.txt to test\test2\One\twd.txt.
  4.  Renaming           'test\test2\One\two\three\ozorroee' to 'test\test2\One\twde' ...
  5. Successfully renamed test\test2\One\two\three\ozorroee to test\test2\One\twde.
  6.  Processed        'test\test2\One\two\three' ...
  7.  Skipping         'test\test2\One\two' ...
  8.  Skipping         'test\test2\One' ...
  9.  Skipping         'test\test2' ...
  10.  [STATS] Renamed 2 files and directories (0 failed, 4 skipped).

2019-01-15 10_48_53-K__test.png

Or something.  :huh:

 :P

OK, so if I've got this right, maybe, the full path is split into two parts only to be acted upon:

  • \test\test2\One\two\three\ozorroee\
  • ofile.text

?
554
Post New Requests Here / Re: Folder Organizer/Sorter
« Last post by 4wd on January 14, 2019, 05:40 PM »
Given a directory of files, you want to scan the zip files in that directory looking for files with a certain extension.  Given that a file with this extension is in the archive, you want to move the entire archive to a directory which you will specify.

Not just zip files.

Scan any and all files/archives within a directory for any files/folders matching a given extension (for files) or name (for folders) and then copy/move either that file (if standalone) or the archive (containing files with specified extension and/or folder with the specified name) to a final destination.

The ability to input multiple file extensions/folder names to search for 'would be nice'.  :)
555
EDIT: You uploaded 1.3.0 while I was typing this, so used 1.3.0.

Still trying to work out what's supposed to happen w.r.t. paths/files using Regex so:

remv -sndrvv "o(.+)e(.+)" d$1$2 test

Acting on:
\test\test2\One\two\three\ozorroee\ofile.text

What do you think should be the expected outcome, (before running remv on it - what do you think the final full path should be)?

BTW, it suggested three (3) renames but did four (4)  ;)


And wait until you try non-greedy Regex:

remv -sndrvv "o(?:.+)e(.+)" d$1$2 test
556
Yes, it does - so you can match subfolders.  :)

Not sure you got what I meant:

Would rename     'test\one\three\one\fred.pdf' to 'test\dne\three\one\frd.pdf' ...

Given the Regex I used it looks like the groups were:
test\o(ne\three\one\fr)e(d)

ie. The complete path was handled as a string instead of each component of the path, (directories and file), handled individually, (test, one, three, one, fred - each having the Regex performed against them).

If that's the way it's supposed to work then, no offence, it's going to be the strangest rename program I've ever seen and make working out the Regex a bit more complex, (although it would allow renaming dirs/files based on parent and/or sub-dirs).

Need more clarification.

Of course, it could of just been a complete fluke that I happened to create a directory structure and choose a Regex that would bring about this confusion ...

I don't know if you noticed but it was suggesting directory name changes even though I hadn't specified the -d parameter.

If they are a part of the path to a regular file, yes. You cannot rename a whole directory without a file in it though.
I could make the non-d call skip subfolders, but then -d would be the same thing as not using -r, or am I mistaken?

I think this is connected with the point above, is the full path handled as a string or are directories and files handled on their individual names?

Code: Text [Select]
  1. ls * | sed -E 's/(.*)text(.*)to(.*)remove(.*)/mv & "$1$2$3$4"/' | sh

Would a recursive version be the equivalent of changing to the next sub-dir and performing the same command?
557
Hmm, that might be fixed with a simple call to create_directories before renaming, so the target directories will be created even if the original directories didn't match your regex.

BTW, I don't know if you noticed but it was suggesting directory name changes even though I hadn't specified the -d parameter.

Actually, looking at the results  again, I would say it's matching against the complete path instead of the individual components of that path.
558
Post New Requests Here / Re: Folder Organizer/Sorter
« Last post by 4wd on January 13, 2019, 04:06 PM »
What I am looking for;

Be able to input a folder destination (create one if not done), scan for files with a specific extension in/out of a compressed folder, and/or scan for specific directories in a compressed folder and then move/copy files in target directory.

This point needs clarification about what 'file' is being referred to for copying/moving, the one in the archive or the archive itself.
I think the latter due the earlier mention of 'sorted according to content'.

ie. The archive is kept intact and copied/moved to it's final destination according to its contents.
559
Living Room / Re: Interesting "stuff"
« Last post by 4wd on January 13, 2019, 03:58 PM »
Heads Up Driving

[ Invalid Attachment ]

These things have been around for years, save some money:
https://www.aliexpre...Car/32857395000.html
https://www.aliexpre...lay/32956414277.html
https://www.aliexpre...one/32930732684.html
etc


A lot of them don't do well (a) in the heat, or (b) in continued sunlight.  Be wary and look for long-term use reviews.

That too, there's very little of these things that will last through an Australian Summer, not even most dashcams if they have a battery in them.
560
Living Room / Re: Interesting "stuff"
« Last post by 4wd on January 13, 2019, 03:18 AM »
562
If you want v6.6 for the Move To functionality, it's still available on uptodown.
Windows Defender accused malicious software for this version 6.6, perhaps a false-positive. Interestingly I had an old version 6.3 that I used for a two or three years without alarms, but that now Windows 10 also accuses. I forced the installation of this FMT version and when configuring it the system crashed.

I have FMT v6.6 on my Win10Pro system as a portable install, neither Defender or MBAM complain about it.

It doesn't crash when run or configured either.
563
Unfortunately, I kind of got the $regexReplace wrong :-[
Would have failed if $ignoreExt = $false

Need to directly input the Regex replacement string because of the way PowerShell handles references, (specifically using $ with ' or ") - adjusted script.

Probably a way around it but my brain isn't up to it atm.


Fixed, needed to escape the back references with `
564
FWIW, this is a small PowerShell script I put together to check against what I was testing above:

Code: PowerShell [Select]
  1. # Folder to act on
  2. $folder = 'K:\test-ps'
  3. # Regex to match
  4. $regexMatch = "o(.+)e(.+)$"
  5. # Regex to replace
  6. $regexReplace = "d`$1`$2" # Must remember to escape the back references DOH!
  7. # Ignore extension
  8. $ignoreExt = $true
  9. # Grab the directory tree
  10. $a = Get-ChildItem $folder -recurse
  11. # Sort by folder depth
  12. $b = ($a | Select-Object FullName, @{Name="FolderDepth";Expression={$_.DirectoryName.Split('\').Count}} | Sort-Object -Descending FolderDepth,FullName)
  13. # Loop through each file/dir name seeing if it matches and output the result
  14. for ($i = 0; $i -lt $b.Count; $i++) {
  15.   # Output the last part of the path we're testing
  16.   Write-Host (Split-Path $b[$i].FullName -Leaf) -NoNewline
  17.   if ($ignoreExt) {
  18.     # Ignoring extension
  19.     # Grab the last part of the path (file/folder)
  20.     $t1 = (Split-Path $b[$i].FullName -Leaf)
  21.     # Grab name without extension and replace matches
  22.     $newName = ([io.path]::GetFileNameWithoutExtension($t1) -replace $regexMatch, $regexReplace)
  23.     # Output result
  24.     Write-Host " -> $($newName)$([io.path]::GetExtension($t1))"
  25.   } else {
  26.     # Include extension
  27.     # Grab the last part of the path (file/folder) and replace matches
  28.     $newName = ((Split-Path $b[$i].FullName -Leaf) -replace $regexMatch, $regexReplace)
  29.     # Output result
  30.     Write-Host " -> $($newName)"
  31.   }
  32. }


Sample output
Code: Text [Select]
  1. PS Z:\test\_Coding Snacks> Z:\test\_Coding Snacks\remv-test.ps1
  2. fred.pdf -> fred.pdf
  3. two.pdf -> two.pdf
  4. one.pdf -> one.pdf
  5. harry.pdf -> harry.pdf
  6. evie.pdf -> evie.pdf
  7. three.pdf -> three.pdf
  8. one -> one
  9. two -> two
  10. one -> one
  11. two -> two
  12. three -> three
  13. two -> two
  14. one -> one
  15. three -> three
  16. one -> one


No guarantee it's correct either  ;)
565
General Software Discussion / Re: Disabled Services in Windows 10
« Last post by 4wd on January 10, 2019, 06:09 PM »
Yes, 4wd, excellent lead for those that don't know about Black Viper.

I'll also point out this post I made awhile ago: BlackViperScript
566
Living Room / Re: Durability of USB ports and plugs?
« Last post by 4wd on January 10, 2019, 05:58 PM »
Wiki: USB (Physical)w

Standard USB has a minimum rated lifetime of 1,500 cycles of insertion and removal, the mini-USB receptacle increases this to 5,000 cycles, and the newer Micro-USB and USB-C receptacles are both designed for a minimum rated lifetime of 10,000 cycles of insertion and removal. To accomplish this, a locking device was added and the leaf-spring was moved from the jack to the plug, so that the most-stressed part is on the cable side of the connection. This change was made so that the connector on the less expensive cable would bear the most wear.

As always, this doesn't take into account abuse and quality.

So, in theory, the standard A socket at the computer end will fail before the end you plug into your phone. :)
567
remv 1.2.0

OK, something seems to be wrong:

Initial structure:
2019-01-11 09_46_57-K__test.png

Code: Text [Select]
  1. K:\>remv -Ervvns o(.+)e(.+)$ d$1$2 test
  2.  Would rename     'test\two\one\two.pdf' to 'test\twd\on\two.pdf' ...
  3.  Skipping   'test\two\one'.
  4.  Skipping   'test\two'.
  5.  Skipping         'test\three\two\one.pdf' ...
  6.  Skipping   'test\three\two\one'.
  7.  Skipping   'test\three\two'.
  8.  Skipping         'test\three\three.pdf' ...
  9.  Skipping   'test\three'.
  10.  Would rename     'test\one\two\harry.pdf' to 'test\dn\two\harry.pdf' ...
  11.  Skipping   'test\one\two'.
  12.  Would rename     'test\one\three\one\fred.pdf' to 'test\dne\three\one\frd.pdf' ...
  13.  Skipping   'test\one\three\one'.
  14.  Would rename     'test\one\three\evie.pdf' to 'test\dne\three\vie.pdf' ...
  15.  Skipping   'test\one\three'.
  16.  Skipping   'test\one'.
  17.  [STATS] The simulation suggested 4 renames. Note that some of them might fail.

Taken from the top for the 'Would rename ...' lines, I would have thought given o(.+)e(.+)$ and ignoring extensions:
Would rename     'test\two\one\two.pdf' to 'test\twd\on\two.pdf' ...
'test\two\one\two.pdf' -> 'test\two\one\two.pdf'  - Skip it

Would rename     'test\one\two\harry.pdf' to 'test\dn\two\harry.pdf' ...
'test\one\two\harry.pdf' -> 'test\one\two\harry.pdf'  - Skip it

Would rename     'test\one\three\one\fred.pdf' to 'test\dne\three\one\frd.pdf' ...
'test\one\three\one\fred.pdf' -> 'test\one\three\one\fred.pdf' - Skip it

Would rename     'test\one\three\evie.pdf' to 'test\dne\three\vie.pdf' ...
'test\one\three\evie.pdf' -> 'test\one\three\evie.pdf' - Skip it

ie. None of them match the given criteria.

The actual result:
Code: Text [Select]
  1. K:\>remv -Ervvs o(.+)e(.+)$ d$1$2 test
  2.  Renaming     'test\two\one\two.pdf' to 'test\twd\on\two.pdf' ... error: operation not permitted
  3.  Skipping   'test\two\one'.
  4.  Skipping   'test\two'.
  5.  Skipping         'test\three\two\one.pdf' ...
  6.  Skipping   'test\three\two\one'.
  7.  Skipping   'test\three\two'.
  8.  Skipping         'test\three\three.pdf' ...
  9.  Skipping   'test\three'.
  10.  Renaming     'test\one\two\harry.pdf' to 'test\dn\two\harry.pdf' ... error: operation not permitted
  11.  Skipping   'test\one\two'.
  12.  Renaming     'test\one\three\one\fred.pdf' to 'test\dne\three\one\frd.pdf' ... error: operation not permitted
  13.  Skipping   'test\one\three\one'.
  14.  Renaming     'test\one\three\evie.pdf' to 'test\dne\three\vie.pdf' ... error: operation not permitted
  15.  Skipping   'test\one\three'.
  16.  Skipping   'test\one'.
  17.  [STATS] Renamed 0 files (4 failed, 11 skipped).

568
Why do I even publish software one year in advance if people don't test it before it's too late?  ;D

I was having a break from thinking last year  :)
569
General Software Discussion / Re: Disabled Services in Windows 10
« Last post by 4wd on January 09, 2019, 04:59 AM »
http://www.blackvipe...vice-configurations/

NOTE:
This information is based upon the Windows 10 April 2018 Update (version 1803/17134.1) released April 2018.

Please note: this information is no longer updated. Please take that fact into consideration when reviewing this information.

But still a very good starting point.
570
remv 1.1.1 from the OP.

Some observations, which might be attributable to my appalling lack of RegEx knowledge.

The test subjects in their original positions and a dry run:
2019-01-08 10_49_52-C__WINDOWS_system32_cmd.exe.png

2019-01-08 10_50_52-C__WINDOWS_system32_cmd.exe.png
  • Output is munged:
    • single line output
    • the whole .\.\ thing as well as '.\dir\.\dir\file'
  • The executable has renamed itself, it would be better if it excluded itself from the operation, (no matter what name the executable has been given).
  • More importantly, the file renaming failed and this, (as indicated by the output), is because the directories were renamed first thus any files within those directories were now non-existent.  I would suggest the renaming start at the lowest level and work up.

2019-01-08 10_51_47-C__WINDOWS_system32_cmd.exe.png
  • Same results as above but the output is now multi-line.
  • It would be better, (I think), if instead of saying Processing 'something' against items that don't match, it said Skipped 'something'.  It would help with quickly scanning the output to see what was skipped or having the output redirected to a file and searching that for Skipped.
571
What!?

That easy??

Well, I could try and make it harder but ... meh :)

FYI
572
You can use the Send To menu, just drop shortcuts to folders in there, hold down Shift if you want to move the files.
573
Something like that:

Code: PowerShell [Select]
  1. $w = $x = $y = $z = $true
  2.  
  3. do {
  4.   if (!(Test-Path W:\)) {
  5.     Start-Process -FilePath "net.exe" -ArgumentList "use W: \\NAS\backups /PERSISTENT:YES" -Wait -WindowStyle Hidden
  6.   } else {
  7.     $w = $false
  8.   }
  9.   if (!(Test-Path X:\)) {
  10.     Start-Process -FilePath "net.exe" -ArgumentList "use W: \\NAS\homes /PERSISTENT:YES" -Wait -WindowStyle Hidden
  11.   } else {
  12.     $x = $false
  13.   }
  14.   if (!(Test-Path Y:\)) {
  15.     Start-Process -FilePath "net.exe" -ArgumentList "use W: \\NAS\media /PERSISTENT:YES" -Wait -WindowStyle Hidden
  16.   } else {
  17.     $y = $false
  18.   }
  19.   if (!(Test-Path Z:\)) {
  20.     Start-Process -FilePath "net.exe" -ArgumentList "use W: \\NAS\temp /PERSISTENT:YES" -Wait -WindowStyle Hidden
  21.   } else {
  22.     $z = $false
  23.   }
  24. } while ($w -or $x -or $y -or $z)

Haven't tested it but the theory is sound  :)
574
This thread was about a similar problem, there didn't seem to be any resolution regarding mapped drives then either.

But who knows, maybe something in there will work better on 10 than it did on 7.

EDIT: Also this old PoSh script I did might provide some inspiration.
575
If you want v6.6 for the Move To functionality, it's still available on uptodown.
Pages: prev1 ... 18 19 20 21 22 [23] 24 25 26 27 28 ... 225next