Link to home
Start Free TrialLog in
Avatar of pcmagic2004
pcmagic2004

asked on

deleted and important file

I accidently deleted a file in the windows folder that looked like spyware.  I never emptied the recycle bin so i know its there.. are there any dos commands to restore it?
Avatar of SheharyaarSaahil
SheharyaarSaahil
Flag of United Arab Emirates image

Hello pcmagic2004 =)

hmmmm I dont have any Win98 machine to test it right now... but if im not mistaken, win98 stores recycle bin files in a folder called Recycled which can be accessed from C:\ , means C:\Recycled
so if you are sure that the files were not deleted from recycle bin, dont yu think that they should be present in this folder still :-?

And if So, then u can copy that deleted file from there back to its original location to check if it can sort out the problem for u or not..... ??
and BTW i think that this Recycled folder must be hidden folder, so u will be needed to unhide it before u can get access to it, and when u will restore the file, COPY it, dont move it, so that you will still have a file in the recycle bin :)
Avatar of dxf224
dxf224

you shouldnt have to use dos ... just sort by date if it's a fairly current deletion.    ....or by x  ... or by  y ......
.... very short tutorial here ...www.chilibsys.org/ce/w95/w9526.html     .... as far as I know there are no dos commands to restore a deleted file.
Avatar of pcmagic2004

ASKER

okay well i can't get into windows to do the simple fix dxf......i checked the recycle bin and the file isn't coming up in there.. any other suggestions
can i ask which file you deleted.... may be we can get it from another system to copy it to your system :-?
Maybe you can extract the file from the installation CD using the Windows 98 Startup floppy disk and the ext command.

http://support.microsoft.com/default.aspx?scid=kb;en-us;129605
the file is win.com
after extracting the file, i get a "file creation error".. it just seems so easy because the file is in the recycle bin!
Description of the System File Checker Tool (Sfc.exe)
http://support.microsoft.com/default.aspx?scid=kb;en-us;185836

Start > Run sfc /scannow

From DOS: Go to C:\WINDOWS\SYSTEM and type SFC and choose Check for missing/corrupt files
Have the Windows CD ready.

Might be easier to do a dirty install:

Dirty Install of W98 (WinME)

You might have to install W98 over itself to fix it.  
Do Not FORMAT, Do NOT FDISK.  
Run the setup program from the CD or WINDOWS\OPTIONS\CABS or INSTALL folder.
This should save all of your settings and programs.
Also make sure you install to WINDOWS not WINDOWS001 ( or whatever ) when it asks where to install.
You deleted Win.com, thinking it to be a spyware !!! I am sorry to hear that.

Anyway, don't panic.

Boot into DOS mode (that's all you can do at present, no ? :)

Go to root (C:\).
CD to RECYCLED.
(All files deleted from windows are there in this dir hidden under Windows).

You will find your file here, but it will have a different name. If you have only one .com file under RECYCLED, copy it to your Windows folder with name Win.com
(copy C:\RECYCLED\dd1.com C:\WINDOWS\WIN.com)

Now you should be able to boot into Windows.

Or, you can copy Win.com from another W98 PC, and copy it to Windows folder.


See this:

Creating a New Win.com File When You Cannot Start Windows
http://support.microsoft.com/kb/q136630/

Good luck,

Zee
I agree with paraghs in that you should be able to retrieve the file, but there is one thing you may have to do first to allow you to copy the file.  The C:\RECYCLED folder is a System Folder and also Hidden, so it possibly won't allow you to copy the contents out of it.  If you type the following command from the C:\> Prompt:

attrib  recycled

you should see this:

     SH      RECYCLED      C:\RECYCLED

The "S" and "H" mean System and Hidden Attributes respectively, which is what this folder should be.  If you type the command:

attrib -h -s  recycled

it will remove these attributes, and allow you to copy the file out using paragh's command:

copy  c:\recycled\dd1.com   c:\windows\WIN.com

Once done, restore the correct attributes to the recycle folder with the reverse procedure:

attrib +h +s  recycled

Power Off, and then power up and see if Windows starts up.

If it won't allow you to copy dd1.com, then check the attibutes and remove them if it shows hidden or system.

attrib  recycled\dd1.com

attrib  -h  -r  -s  recycled\dd1.com
Hi Bill,

I just checked a Win 98 PC by booting it into DOS mode.
While RECYCLED folder is hidden under windows, it is accessible in DOS without any extra effort.

This is because RECYCLED is a Windows system folder, and Windows protects it, but DOS doesn't.

So, attrib command suggested by you will not be required.
In fact, check and see if DOS shows the file using the following command from the C:\> Prompt:

dir  /ah  recycled

The /ah tells it to list only files with the hidden attribute set, and it lists the contents.

I've just deleted a file (NOT Win.com!!, and it wasn't named INFO2 either) to check this.  Here's the command history:

C:\>attrib recycled\info2
  A   H      INFO2         C:\recycled\INFO2

C:\>copy recycled\info2 c:\windows\desktop\test1.txt
File not found - recycled\info2
        0 file(s) copied

C:\>attrib -h recycled\info2

C:\>copy recycled\info2 c:\windows\desktop\recovered.txt
        1 file(s) copied

Opening the recovered file with NotePad, I now remember that it was clock.ini, and this is what notepad shows:

C:\WINDOWS\clock.ini \clock.ini  C:\RECYCLED\DC0.INI

The file wasn't actually moved to the Recycle Bin at all, it stayed in the same place on the hard drive.  The index or directory entry (comprising the complete path and filename of the file) was placed in the Recycled folder.  The file was then renamed, but would no longer be seen on the hard drive because the link to it was broken. The original name and location of the file are stored in the hidden index file, called INFO2 in the Recycled folder.

If you had been able to restore the file in Windows, the original path would have been read from the INFO2 file and the original file would have been renamed back to WIN.COM, and its directory entry restored.

Bill,

You must be aware that the concept of Recycle Bin was taken from Macintosh Trash Can.

Although the files deleted by you are not removed from your hard disk, its directory entry is deleted, and a reference to original location is stored in Recycle Bin.

Also, while the directory entry of the original location is deleted, OS must assign a file name for the HD sectors that the deleted file was occupying, so that other data is not written to that space. Hence, it is renamed to a different name.

To delete a file without sending it to Bin, you use Shift+Delete.
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial