11-05-2008 07:20 AM
Hi,
I am looking for a VI that allows deleting of files by putting the file to the XP wastebasket (or "tray", "recycled directory"), as usual when I delete filers under XP regularly.
Using the built-in LabView routine "DELETE" from the File I/O directory deletes files completely, i.e. without shifting them to the tray.
Thanks,
Hansjoerg
Solved! Go to Solution.
11-05-2008 07:51 AM
Hi hansjoerg,
move the files to the sub folder in the Recycler folder in your c: directoy.
Mike
11-05-2008 08:49 AM
11-05-2008 09:16 AM
Hi Hansjoerg,
i´m not sure if there is another solution, but you can read the it in the registry. Use following key: HKEY_Local_Machin\Software\Microsoft\Windows NT\CurrentVersion\ProfileList and read in all folders the key "ProfileImagePath". If this path has the login name at the end, then you have found the correct subfolder in the Recycler.
Hope it helps.
Mike
11-05-2008 09:48 AM
Hi Mike,
first thanks for your excellent help!
Thats nearly all the information I needed, except that I also would like to programatically access the login name...
Do you know the registry key for that?
(BTW I wonder why LV still does not have more elaborate "file delete" functions implemented...)
11-06-2008 12:52 AM
Hi Hanjoerg,
you can use a property node to read this information. See the attached file.
Hope it helps.
Mike
11-06-2008 09:00 AM
Hi Mike,
I now have implemented a LabView routine that does exactly what you suggested:
It analyses the key"HKEY_Local_Machin\Software\Microsoft\Windows
NT\CurrentVersion\ProfileList", reads the keys
"ProfileImagePath", and identifies the Path corresponding to the key value with the login name at the end. This identifies the recycler subfolder C:\recycler\.... .
But when I use the Labview "Move" function and shift a file to this directory (I have also tried "D:\recycler\...."), it doesnt neither appear in the XP explorer nor when I click on the wastebasket desktop icon. I only see it (in the correct tray folder) with tools like Windows Commander or so.
Any further hints?
Thanks again,
Hansjoerg
11-06-2008 09:22 AM
Hi Hansjoreg,
sorry for this. I tried it with drag and drop a file into this folder and this works, so i thought it should also work with automatically move it. Please see this search results http://forums.ni.com/ni/search?board_id=170&submitted=true&q=SHFileOperation they should help you.
Mike
11-10-2008 09:26 AM
Hi Hansjoerg,
have you found a solution now?
Try to help.
Mike
11-10-2008 09:32 AM
Hi Mike,
thanks for caring.
No, I have given up somehow cause to me there seems to be no easy way to do what I want. In my understanding now and with my limited capabilities in LabView, after reading in the threads you suggested me it seem that the use of the XP tray needs at least some toolboxes or so that I dont have access to. So I am going for another solution, like creating my own tray dir with Labview and shift deleted files to there. That is a resonable compromise for my purpose.
But thanks again for all your hints!
Hansjörg