New
#1
Could a batch file wipe out a Windows install?
Yesterday I had a collection of batch files which worked, but I wanted to refine them and make them more robust by using variables like %~1. The batch files involved totally removing old folders and subfolders in a specified path and replacing them with ZIP files from a backup.
Well, I converted them fine and they ran with variables provided from a secondary batch file.
HOWEVER, at one point I thought I'd run the original file, and next thing I know I'm getting a lot of unusual filenames from what seems like a system folder and "ACCESS DENIED" all over them, and I realised it was going to try to wipe out my system folders instead, all because the variables were blank.
I stopped the batch file and discovered that apps in "Program Files" had been deleted, but Windows was still operating. I didn't reset, but ran System Restore instead to a Restore Point that had been made just yesterday morning, and whilst it restored fine (I hope) it took a long time to initialise.
As of now everything seems to work again, but my "PerfLogs" file in the C:\ root is gone, and I only hope it's not important. And yes, I immediately put in conditional commands in the batch file to exit if there were no variables, so no more problems there.
But what could've happened otherwise? Can an installation of Windows be crippled or even wiped out by an errant batch file?