Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
7 votes
2 answers
4k views

PowerShell - fast remove a directory with 10,000+ files

I am sick of File Explorer's super slow deletion speed, so I tried to write a PowerShell script to make deletion faster, and while it does its job, its speed isn't as high as what I intended it to be. ...
Ξένη Γήινος's user avatar
66 votes
3 answers
109k views

Delete folder if it exists in PowerShell

In my PowerShell script I'm trying to delete a folder, but only if it exists: if (Test-Path $folder) { Remove-Item $folder -Recurse; } I find myself repeating ...
Jeroen's user avatar
  • 1,441
4 votes
1 answer
4k views

Creating a file of md5 hashes for all files in a directory in PowerShell

I have been trying to write the md5 hashes for all files in a directory and its subdirectories to a file. Ideally, replicating the output of the Unix command ...
Stacey's user avatar
  • 41
11 votes
2 answers
22k views

Powershell search millions of files as fast as possible

I once asked a similar question but in C#. Now I have the same problem in powershell.. What is the fastest way, to search files newer than 15 minutes, in a file system with more than 1 million files? ...
greenhoorn's user avatar
4 votes
1 answer
2k views

Powershell script for zipping up old files

I have a script for zipping up old files. I know using Windows Compression isn't ideal, so I will make the script run using 7-Zip later on. For now though, I just want see how I can make my current ...
techguy1029's user avatar
0 votes
2 answers
2k views

Search files content fast in powershell

I need to search a large repository of files for a specific resource, and return it only if it is used or not. It is working as expected, but it is very time consuming. To search for 50 resource ...
Roman's user avatar
  • 119
10 votes
1 answer
1k views

Batch script to make folders hidden

I just wrote a simple script cmd to hide private folders by combining several scripts from the Internet. Can anyone give me suggestions for improvement? This batch file uses a password hidden by ...
Muthiullah's user avatar
4 votes
0 answers
143 views

downloading a list of urls

I wrote this quick (lots of googling) and dirty (I hope not too dirty) script to download a URL list with a win32 wget port and save them as files with the url as the name to use as a "poor man's url ...
beppe9000's user avatar
  • 191
2 votes
1 answer
163 views

Powershell for syncing Minecraft save files

My code in full plus the task scheduler definition: https://gist.github.com/DaneWeber/0c5e7978bd3927734173e3afdc3d6338 This is my first non-trivial PowerShell script. This was a pretty major learning ...
Dane's user avatar
  • 223
10 votes
1 answer
3k views

MD5 hash comparison for two folders

Using this page for a starting point into comparing MD5 hash values from files in two different folders, I've put something together that outputs either Copied if ...
user4317867's user avatar
3 votes
1 answer
280 views

Get owner of ~5 million files and folders using Powershell and Robocopy

I've written a Powershell script that uses Robocopy to get the full path of all files on a drive and then run it through a foreach loop to get the owner for each file and generate it in a CSV. The ...
Josh's user avatar
  • 31
5 votes
2 answers
501 views

Getting NTFS permissions of all shared folders on the local machine

How can I improve the speed of the script? ...
Cell-o's user avatar
  • 295
2 votes
1 answer
2k views

Create share folder, AD security group, add descriptions, and apply security to new folder

My goal for this script was to: Create new folder Create AD group FS-TESTSHARE-R Create AD group FS-TESTSHARE-RW Apply both groups to the new share folder Set full read permissions to FS-TESTSHARE-R ...
Shane Johnson's user avatar
5 votes
1 answer
148 views

Normalize video filenames and move files to destination directory

I have written a powershell script that will scan a directory for any *mkv, *.mp4, *.avi ...
user2676140's user avatar
2 votes
0 answers
272 views

Syncing NTFS permissions with SMB share permissions

I recently wrote scripts to automate the setup of shares on a server using the New-SmbShare cmdlet. I hadn't realised that this cmdlet doesn't automatically amend ...
JohnLBevan's user avatar
  • 1,409
3 votes
1 answer
1k views

Delete orphaned SIDS + change to full control

I need to delete all the orphaned SIDs in the ACLs of about 20 shares (between 100GB/6TB) and change full control of users groups to other permissions (modify or read/execute). I have done this script ...
user5502079's user avatar
6 votes
1 answer
2k views

A PowerShell script like one-way rsync but worse

This PowerShell script works a bit like a one-way rsync; it's good enough for my Surface RT needs, anyway. However, seeing as this is my first PS script, and I was ...
michaelb958--GoFundMonica's user avatar
2 votes
1 answer
265 views

Copying files, renaming conflicts

I wrote a script to copy a file, but this file already exists in the target directory. So, first I need to rename the original file. The script works, but a colleague did not want to use it because ...
Christianhv's user avatar
4 votes
1 answer
292 views

Powershell photo sorter/mover

I'm just beginning in Powershell - This will be my first full project, start to finish, and it's quite small. I have already had experience in C#, which helps in this .Net based language. This ...
Cullub's user avatar
  • 185