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.