Jump to content
Macro Express Forums
hpram99

How do I delete a file?

Recommended Posts

It seems the delete file function in Macro Express doesn't work as intended, it doesn't delete the file, it simply moves it to the recycle bin.

 

As part of the macro, I'm dynamically creating temporary files that have sensitive information in them, when I'm done, they need to be automatically deleted.

 

I don't know if there's a different way to do this, or if I need to just submit a bug report?

Share this post


Link to post
Share on other sites

Windows still deletes files in the way that you can't simply open a folder and see them. Recovering files using undelete software is not what I'm talking about.

 

Sorry to say, but if Macro Express doesn't delete when it says "delete", I call that a bug.

 

To be honest, I'm not exactly sure that this will be fixed, as previous feature requests have so far been ignored. This make me a little uneasy when we just purchased 100 licenses. Not to mention I would have to completely redeploy it when this is fixed. Is there not a way to delete files within macro express?

Share this post


Link to post
Share on other sites
Windows still deletes files in the way that you can't simply open a folder and see them.
When a file is deleted in Windows it is moved to the recycle bin. When a file is deleted in Macro Express it is also moved to the recycle bin.

 

Recovering files using undelete software is not what I'm talking about.
Neither was I.

 

Sorry to say, but if Macro Express doesn't delete when it says "delete", I call that a bug.
It works the way Windows works. In fact, it uses Windows to perform the delete. And when Windows deletes the file for Macro Express, it moves it to the Recycle bin. This is not a bug. It is an intentional feature.

 

What you are asking for is a new feature that will delete a file without sending it to the recycle bin.

 

To be honest, I'm not exactly sure that this will be fixed, as previous feature requests have so far been ignored.
No feature request is ignored. All requests are considered. Just because something is not implemented does not mean it was ignored. Not all requests can or will be implemented. That is why they are called 'requests'. ;)

 

This make me a little uneasy ...
If this is an important issue for your company contact the Insight Software Solutions support people directly to discuss it further.

 

We would like to again thank Professional Grade Macros for hosting this forum. Please remember that while Insight Software Solutions employees may read and post in this forum the official source for customer support from Insight Software Solutions is to contact them directly. See www.macros.com/support.htm for support options.

Share this post


Link to post
Share on other sites

I just talked to the Insight Software Solutions support people and they suggested that you check out the Empty Recycle Bin macro command. Maybe you can empty the recycle bin after deleting a file?

Share this post


Link to post
Share on other sites
It seems the delete file function in Macro Express doesn't work as intended, it doesn't delete the file, it simply moves it to the recycle bin.

 

As part of the macro, I'm dynamically creating temporary files that have sensitive information in them, when I'm done, they need to be automatically deleted.

 

I don't know if there's a different way to do this, or if I need to just submit a bug report?

We also ran into this same problem a few years ago.

 

Our 'work around' involves a few things:

 

First, after the macro is finished with the temporary file, the macro Renames the file to "TRASH" (no file extension). If it was a notepad (.txt) file, the renaming part destroys the association to notepade so the contents can't be viewed.

 

Second, you can use the "Set File Attributes" command to hidden=true.

 

Third, we used the Move File command, and moved it to our own "Trash" folder on our network. By moving it to a folder (and not the windows recycle bin), it will overwrite the previous file named "TRASH". (There can only be 1 file named "TRASH" in that folder.)

 

Finally, you can have a scheduled macro that runs once a day (or whenever) move the "TRASH" file to the window's recycle bin using the "Delete File" command in Macro Express. Originally, we used to do this once a day, then we just stopped moving the file to the Window's recycle bin. By moving the file on our network to a secret "Trash" folder, we felt it was sufficient since the file was always being overwritten, and was 'hidden'.

 

Ahhh.. i just had an epiphany. After you have moved the file to your secret "Trash" folder, you could have macro express create an empty notepad file, and then rename it to "TRASH", and then move it to your secret "Trash" folder (which will override the file containing potentially sensitive information with a blank file with no data).

 

I think I will update our macro to do this! :)

Share this post


Link to post
Share on other sites

Yes, the lack of a 'hard delete' option in macro express is sometimes a pain in the neck. It's appropriate that macro express supports the existing functionality of using the recycle bin, but it should also have an option to bypass the recycle bin. (The macro express help file is clear that deleting a file really only sends it to recycle bin.)

 

If using the 'empty recycle bin' command is not acceptable for your situation (e.g., you can't delete all the other contents of the recycle bin), then you simply need to overwrite the file when you are done with a new file of the same filename with empty or garbage contents, as per Marcopolo's suggestion. You can then delete your dummy file (that is, move to recycle bin), and even if somebody later recovers the file from the recycle bin, the file no longer contains the sensitive information.

 

Another option to consider is whether you really need to store the sensitive information in a temporary file, or can you have that information go into a macro express variable or environment variable?

Share this post


Link to post
Share on other sites
Yes, the lack of a 'hard delete' option in macro express is sometimes a pain in the neck. It's appropriate that macro express supports the existing functionality of using the recycle bin, but it should also have an option to bypass the recycle bin. (The macro express help file is clear that deleting a file really only sends it to recycle bin.)

 

If using the 'empty recycle bin' command is not acceptable for your situation (e.g., you can't delete all the other contents of the recycle bin), then you simply need to overwrite the file when you are done with a new file of the same filename with empty or garbage contents, as per Marcopolo's suggestion. You can then delete your dummy file (that is, move to recycle bin), and even if somebody later recovers the file from the recycle bin, the file no longer contains the sensitive information.

 

Another option to consider is whether you really need to store the sensitive information in a temporary file, or can you have that information go into a macro express variable or environment variable?

 

I appreciate the suggestions and ideas, in the mean time I had been devising my own way of "deleting" these files.

 

I now pass sensitive information to a vbs using arguments, and when I'm done I use a blank variable to overwrite the temp file. I just leave it in windows %temp% file, as it is going to get overwritten again next time the macro is run.

 

-- Let me tell you, one of these macros will run every 30 minutes on our fileserver to generate a report. The first time I looked at the recycle bin and saw 1300 files in the trash containing passwords; I almost fell off my chair.

Share this post


Link to post
Share on other sites
Ahhh.. i just had an epiphany. After you have moved the file to your secret "Trash" folder, you could have macro express create an empty notepad file, and then rename it to "TRASH", and then move it to your secret "Trash" folder (which will override the file containing potentially sensitive information with a blank file with no data).

 

I think I will update our macro to do this!

You should be aware that the method you describe here does not prevent someone recovering all your files named Trash with the right software, e.g. Winternals FileRestore. Once a file exists on your disk, the only way to ensure it's really deleted is to use a secure erase utility (there are plenty of these utilities available). This is because deleting a file simply removes it from the FAT or NTFS directory; the space occupied by your deleted file becomes available for reuse, but it's impossible to know when that reusable space is actually used again - it could be immediately, it could be in 12 months from now.

 

You can easily prevent any file going to the recycle bin by right-clicking on the recycle bin, selecting Properties and checking "Do not move files to the &Recycle Bin. Remove files immediately when deleted" (and note the &R in this text - you could have your macro check this box before deleting the file by typing R into this dialogue box, then unchecking the box after the deletion). But, again, the file could still be recovered with Winternals FileRestore.

Share this post


Link to post
Share on other sites

Another way to delete, which doesn't seem to use the Recycle Bin, is to use the DOS command:

launch program c:\windows\system32\cmd.exe

and pass it parameter

/C delete c:\FolderABC\FileXYZ

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...