How to Clear Archive & Read-only flags on Files in Windows in Bulk
I ran into an issue where I had to move files from one system to another and was running into issues because files had been set as read-only, had the archive flag set, or both. It was causing the system to skip files which wasn't acceptable. Normally you could just use Windows to clear it in bulk, but that could potentially mess up file permissions. I needed a way to automatically just clear all flags but respect permissions.
I did some searching and didn't find a utility that would do the job and most of the solutions I found required Powershell which wasn't available on the system I was on. I ended up writing a quick console application in C# to do the trick. I've made it free and open sourced it in case anyone wants to use it.
If you need just the app, you can find the release build here with instructions. The app also prompts for input to make things a bit easier to use. There's no install, no tracking or metrics, or anything else related to privacy concerns in this app. It's a simple throwaway utility to get the job done and move on.
https://github.com/gregvarghese/clearflags/releases/tag/1.0.0
If you want to see the source code, that is available here:
https://github.com/gregvarghese/clearflags/
Please note that I did this in about 10 minutes for my own use so error handling is pretty much non-existent. I mention this because I did run into one issue where Windows was somehow seeing a folder with files in it as a file and it couldn't be deleted or renamed and the utility couldn't get past it until it was resolved. I didn't spend much time debugging and just used my Mac to rename the folder and Windows was able to recognize it after the change, so the utility was able to continue processing.
List of my must-have Alfred Workflows
Use a mac? You'll want to grab Alfred App. I'm finding it an invaluable replacement for spotlight and the workflows allow me to supercharge my workflows. It's so useful that I've purchased the Powerpack lifetime license. In addition to the standard features, here are a list of the most useful workflows for dev/tech: Kill process – by Nathan Greenstein (@ngreenstein) I use it as an activity monitor for CPU usage, and from there I can easily force quit any process if needed. It’s easier to see all processes on the Alfred UI instead of opening Activity Monitor on your mac. There’s also the workflow Kill Application – by Sebastian Hallum Clarke (and also on his site you can find other cool workflows). Timer – by Daniel Bader I use this one a lot. It’s super simple and by writing “Timer” and the number of minutes, you can easily set a reminder. It's great for anyone using the Pomodoro technique or even if you leave something on the stove and want to go back to work. Copy SSH Public Key - By oldcai This one saves me time when I need to deploy my SSH key on a new server. Type 'pk [ssh key file name]' and it'll copy the ssh key to the clipboard. Incognito - by Nedwood I find myself using this when I need to test a page and bypass the cache. Type 'incog [url]' and it'll launch a new chrome window in incognito mode. Find Folder by Samvlu Finds a folder by name. I find this is faster than spotlight in just about every search. Smart Folders by Deanishe List all the Smart Folders/Saved Searches (same thing) on your system and drill down into their contents. Works in much the same way as Alfred's File Filter, but Smart Folders are also available outside Alfred and are a bit more flexible. For example, you can configure a Smart Folder to show all video/audio/image files without having to specify each different filetype individually. If you already use Smart Folders, this workflow can save you the work of re-implementing them as File Filters. What's more, you can exclude specific filetypes with a Smart Folder, which Alfred cannot do. Advanced Google Maps Search by stuartcryan This workflow gives you some quick and dirty shortcuts into Google Maps: Commands: To Configure: mapsethome <home address including street number, name, postcode> (i.e. what you would type into Google Maps) mapsetwork <work address including street number, name, postcode> (i.e. what you would type into Google Maps) Commands for Use: maps <query> - Search Google maps for an address dir <query> to <query> to <query> etc (seperate multiple addresses with " to " minus the quotes, and you will get a multiple location search) dirfw Show directions from Work to address dirfh Show directions from Home to address dirtw <query> Show directions from query to Work address dirth <query> Show directions from query to Home address trafficw - Show traffic from Home to Work traffich - Show traffic from Work to Home StackOverflow Search by deanishe If you use stackoverflow as much as I do, this is a must-have. Date Calculator I find myself needing to calculate differences between dates in my personal life a lot lately. This workflow saves me a lot of time to do that. Want to know how far Christmas is away in days? 'dcalc 12-25-16 - now d' returns the number of days (assuming you're using the US short format like I am). Wifi Control by miroman All my Macbooks periodically have issues with wifi. I've never been able to figure out what's causing it but I use Wifi Control to restart the wifi which allows me to connect successfully. Bugnot by vitor If you use bugmenot at all, this is a useful extension to get logins without loading a new tab. Type 'bn domain.com' and you'll get a list of matching passwords to use.
When updating Office 2011 for Mac, you are prompted that you must close “Microsoft Database Daemon” and “SyncServicesAgent”
If you're trying to update your install of Microsoft Office 2011 for Mac, you may get the following message: "These applications must be closed before the software can be installed: Microsoft Database Daemon SyncServicesAgent Close these applications and try again" If you try to kill the apps using activity monitor, you'll find they keep getting restarted. The only way I found that worked to stop them is by following the instructions below.
Kill Multiple Processes at Once Via Command Line with Taskkill
Ever have a program or process that doesn't end properly and runs in the background continuously? I recently encountered this issue with VLC on one Windows 7 machine where it keeps the process never terminates. Since I never reboot the machine for other than Windows Updates, this amounted to 633 copies of VLC running in memory. Each process only used about 633k so it wasn't an astronomical memory hog but multiply that by 633, you begin to feel the machine slowing down. Task Manager doesn't let you kill multiple processes in bulk and I didn't want to go through killing them one by one or rebooting. The solution? Good old command line. Open up command prompt (start -> run -> cmd.exe). This snippet will kill all processes that start with the taskname:
Secrets, oh my
It amazes me sometimes the lengths that companies go to "protect" their products but then make so simple to work around. I am trying to get a program called NeatReceipts to work on my machine and am running into serious issues with it because of a crappy installer. It keeps failing when installing the database. Of course it tries to be slick and install in a password protected instance with a hidden password. Naturally as a tech, I'm inclined to fix problems on my own PC. So I'm poking around to figure out exactly what's happening and why it is failing. There's no real information as to why it fails. It doesn't even notify me that there's been a failure, it actually tells me it's successful. So I'm tracing all the steps backwards and trying to figure out how to get the SQL instance setup. Of course there's no information on this anywhere. So I do further sleuthing and stumble across log files created by the installer in another folder with this in plaintext: Executing sqlexpr32.exe -q INSTANCENAME=NR2007 SECURITYMODE=SQL SAPWD=nr-2006-s@pwd-t6r5y7n9y7t6y7 ADDLOCAL=SQL_Engine,SQL_Data_Files SQLAUTOSTART=0 REBOOT=ReallySuppress /qn Now it just makes me wonder, if you're going to be all paranoid and choose a password that is really that complex and unguessable, why store it in a plain text where anyone with brains could see it? It reminds me of the time when Quickbooks wouldn't help my company unlock the SQL database when we were looking to integrate another product. The actual response we got back from them regarding the password was "Guess." Not very smart when you have a team of intelligent geeks who's primary job is figuring out how stuff works. We didn't waste time figuring out the password though. Instead we used a backdoor solution of backing up the database and restoring it which gave us full access to the entire DB.