ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Need a recursive utility

(1/1)

fdwojo:
Hey there folks. I'm in need of a utility that can either:

1) allow me to execute a standard DOS/CMD command in every sub-directory of a particular folder
  or
2) create a 0-byte file in every sub-directory of a particular folder, all with the same name of my choice.

Way back in the day of Windows 95 and MS-DOS, I had a tool that would do option #1, but it seems those older 16-bit tools don't work in Windows 10. I've tried the FOR /R tool, but it doesn't seem to be able to create files, only manipulate existing files which is no help.

Does anyone know where I could find a tool like that? *** or *** could someone here write a utility that will do that?

Thanks for reading! Please let me know if you have any thoughts of an existing tool, or if creating one is possible.

4wd:
Simple PowerShell script to create zero byte file in all sub-directories:


--- Code: PowerShell ---<#p0b.ps1 In a Powershell console: path/to/p0b.ps1 -dir <dir> -file <file> Example: ./p0b.ps1 -dir r:/abc -file hello.txt #> param (  [Parameter(Mandatory = $true)][string]$dir,  [Parameter(Mandatory = $true)][string]$file) # Get a list of all sub-dirsGet-ChildItem -Path $dir -Recurse -Directory | `# For each one create a file  ForEach-Object { New-Item "$($_)/$($file)" -ItemType File -Force}
NOTE: The -Force parameter will cause existing files to be overwritten, remove it if necessary.

PS. PowerShell doesn't care what you use for a path separator, / or \

publicdomain:
could someone here write a utility that will do that?-fdwojo (May 27, 2021, 05:35 PM)
--- End quote ---

Hi there! :) Adding RecuRUN to the thread:

https://www.donationcoder.com/forum/index.php?topic=51481.0

Need a recursive utility

Enjoy! :Thmbsup:
Vic

Navigation

[0] Message Index

Go to full version