[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 137
  • Last Modified:

Simple VB Script

Need a simple vb script that users can run at logon, checking a date for a certain file and, if less than the script would delete the file.
The file would be located in the root of a Win95 user's personal computer.  The reason for the date specificity is that it is important that the delete happens but once - so a date <= 11/01/99 would be sufficient (for example).

Thanks in advance.
0
PayneB
Asked:
PayneB
1 Solution
 
PayneBAuthor Commented:
Edited text of question.
0
 
vbkecoCommented:
You can use the FileDateTime("Path") function.  Say, for example, that the date you specify as the cutoff is 11/01/1999, and the filename you want to delete is c:\trashme.dat.  Try this:

If Left(FileDateTime("c:\trashme.dat"),10) <= "11/01/1999" then
 Kill("c:\trashme.dat"
else
end if


0
 
MoondancerCommented:
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed.  Also a question is posted there specific to these changes that apply to the experts here.  Also, I am including the link to our All Topics, since many new ones have recently been added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now