Beware of the “As Administrator” option on Windows 8

Yesterday, I was preparing my Windows 8 Tablet PC for development and testing. As always, I went to use the “_clear.cmd” file from the “Lib” folder to delete old files before preparing a new package. But – wait! Windows 8 won’t let me run CMD files just like that! It blocked every time. So … to outsmart this new Windows 8 feature (I think it’s called “Screen-Scan”), I’ve simply selected “As Administrator” to run the “_clear.cmd” file with higher access rights.

Imagine my surprise when the Command Line Window scrolled a long list of warnings about DLL files being deleted, even though there should have been no DLL files in the “Lib” folder where that “_clear.cmd” file was located. My first thought was: What’s going on here? I’ve edited the “_clear.cmd” file and added a PAUSE command at the end, then executed it again.

Guess what. The “_clear.cmd” file, which was still located in the “RTC SDK/Lib” folder, was being executed from inside the “Windows/System32” folder. And thanks to Admin rights and that “DEL *.DLL” line, a number of DLLs have been deleted.

No, I wasn’t Angry. I was MAD! About 10 hours later, trying all the other alternatives, I’ve had to reinstall Windows. Fortunately for me, Windows 8 makes it very easy to execute a clean install (it only took 30 minutes) and there was nothing on that PC except Delphi and RTC SDK files, so it wasn’t a huge loss. So … I’ve learned my lesson to ALWAYS use the “As Administrator” option WITH CAUTION. Especially on Windows 8.

This entry was posted in Articles, General on by .

About Danijel Tkalčec

I was born on March 2nd 1975 in Croatia, in a small town called Čakovec. I have started learning programming in 1985 (at the age of 10) on a Commodore 64, then moved on to  Amiga 500 a few years later, then to an IBM compatible "AT/XP" PC in high-school (1989), where I've been widening my knowledge to other programming languages like dBase, Clipper, Assembly, Quick Basic, Turbo Prolog and Turbo Pascal. After my high-school years, I did my duty and served the Army, working in the Administration and writing custom Applications for Data Management in Turbo Pascal. Returning home, I've continued using Turbo Pascal to develop custom Applications for local Businesses. Then, Microsoft Windows started taking over the World of IBM compatible PCs, and the company behind Turbo Pascal has released "Delphi" for Windows. The rest is history.