Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with a script

Status
Not open for further replies.
Jan 29, 2004
146
US
Who am I kidding? I couldn't script my way out of a paper bag!

I have a problem. We use Macola Accounting software. When people login, 2 files are created in a users directory - usernumber.cfg and usernumber.tmp (i.e., user001.cfg). When people get kicked out for whatever reason, it leaves behind the 2 files and this really hoses things up.

I can manually go in and delete the files of the kicked out users. If I try to delete any user files of people who are really logged in, I get an access denied error because the files are in use.

I did create a script to go through and delete all the files that it could, but it always stops at the first access denied error.

Help, please!
Thanks!
Chris

Christine
 
Have you tried this instruction ?
On Error Resume Next

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yes, I tried that. No luck.
I can't find my last attempt at the script either. Ugh.

I haven't worked on this in a year, but it suddenly became a big deal again.

Christine
 
Jill,
If your only having a problem with deleting the files when someone is logged in, you probably have a process somewhere in task manager that is using those files. Until that process is stopped, you will not be able to delete the files. Try opening up task manager (CTRL+ALT+DEL, click task manager), going to the processes tab and seeing if anything pops up when you start Macola or log into it. This will be the process you want to stop with your script before deleting the files. You can find samples of how to do this at When you go to this site look under "scripting solutions for system administration" then "processes". Its somewhere in there.

ZenKenobi

"I'd rather have a bottle in front of me than a frontal lobotomy." - Tom Waits
 
Oh we actually DON'T want to delete the ones that are in use - those are for users who are still legitimately logged in.

One of my Developers just solved this for me, but he made me an exe, so I don't know how he did it.

Thanks anyway!

Christine
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top