[help] When You Delete A File...

Hi,

May anyone tell when we delete a folder from the desktop or from other place and it goes to the recicle bin, where recicle bin that we have in the desktop stores that file, for restoration if needed ? anyone ?

I need to know this, because id like to configure a samurize script that tells the total files in the recicle bin, but i need a path for it.

Thanks.

Bye.

Sorry my english.

#110047

Hi,

I put the question in other way.

This is a .vbs script, could anyone use it, and tell what path did you put to get the script showing the correct amount of files in the recycle bin

--------------------------------------------------------------------------------------------

Dim vFso, vFolder, vSubFolder, lSubFolder

Dim FolderCount, FileCount

Function GetFolderCount(FolderPath)

On Error Resume Next

FolderCount = 0

countFolderFiles FolderPath

GetFolderCount = FolderCount

If Err.Number <> 0 Then GetFolderCount = "Path not found"

End Function

Function GetFileCount(FolderPath)

On Error Resume Next

FileCount = 0

countFolderFiles FolderPath

GetFileCount = FileCount

If Err.Number <> 0 Then GetFileCount = "Path not found"

End Function

'===========================================================

'===========================================================

'===========================================================

Function countFolderFiles(strPath)

Set vFso = CreateObject("Scripting.FileSystemObject")

set vFolder = vFso.GetFolder(strPath)

CountFiles(vFolder)

Set vSubFolder = nothing

set vFolder = nothing

Set vFso = nothing

End Function

Function CountFiles(folder)

Dim lcsFolder, lSubFolder

set lcsFolder = vFso.GetFolder(folder)

FileCount = FileCount + lcsFolder.files.count

set lSubFolder = lcsFolder.SubFolders

FolderCount = FolderCount + lSubFolder.count

For Each sSubFolder In lSubFolder

CountFiles(sSubFolder)

Next

Set lSubFolder = Nothing

Set lcsFolder = nothing

End Function

-------------------------------------------------------------------------------------------

Thanks a lot.

Bye.

#110110

When you send something to the recycle bin, it is a psudo-delete. That is, where it keeps track what file is where on the hard drive (I forget the name, file allocation table, or similar) it makes the first letter a non-character, like a symbol, so to the operating system, the file is nonexistant, but is still there. And when you empty the trash can, it deletes the info from the table and puts a symbol on the hard drive saying "O.K. you can write info here" That is a simplistic way of saying what's going on.

#110121

Hi,

Okies, but how can i put that working with the script ?

Thanks

If anyone knows please share the info

Bye.

#110130

Although to really to delete file(s) you need to wipe it properly by writing over the spot that the file(s) were in.

When you delete a file it is just like removing the index card in a libary, the book is more difficult to find but it is still there.

I do have an idea how to help you out: try C or your primary hard drive and then Recycled so for instance c:\recycled, it is a hidden folder so you may have to go into tools and show hidden folders.

Glad to help.

-Jimmy S

#110385

surely there's an API call which can do it much more easily. *shrug*

search programing websites.. i'm sure you don't have to actually find a folder.. more of call a function from some random .dll

#110387

the recycle bin is kept in a folder on your system drive (c: in my case) called recycler, in there is another folder with a strange set of numbers as its name ("S-1-5-21-484763869-1004336348-682003330-1003" is mine). this folder contains the contents of your recycle bin.

@echo.>"%temp%\out.txt"
@dir /b "C:\RECYCLER\S-1-5-21-484763869-1004336348-682003330-1003">>"%temp%\out.txt"
@for /f "tokens=1,2,3* delims=:" %%i in ('find /c "D" "%temp%\out.txt"') do set /a number="%%k+0"
@cls
@echo %number%
@pause>nul

for a quick example, put that in a .cmd file and run it... it should display the number of objects in your recycle bin.

note: i have only tested this on my machine, you may need to change the name of the folder inside recycler.

-The Unknown

#110668