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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I write a script to close an open file?

Status
Not open for further replies.

hooman48

IS-IT--Management
Jun 25, 2001
17
0
0
CA
Can I write a script to close an open file?
Thanks
 
yep--

the vbscript fileSystemObject is what you're looking for.

:)
Paul Prewett
penny.gif
penny.gif
 


hooman48,

I don't think so. If a process already has the file open
whether it is through scripting or another EXE, you can not take control of the file just to close it. This would reek havoc on the system. You must be the process owner of the opened file to close it.

fengshui1998
 
The problem is that this is an mdb file that is open by 40 people at any 1 time in different location. Sincce They are using Microsoft Access they can not work together. They don't want to call the helpdesk to see who has the file open since it takes a long time.

I can close the file in server manger or on the console in the command prompt of the NT server but I wanted to write a little script to do this instead and give it to the user.

Thanks.
 


hooman48,

Since this is a database file, you could have several people accessing the file at any time, but only one writing to a specific record. That also depends on the type of cursor you are using. Do you want to close the file to keep all users off or just specific users?

fengshui1998
 
I want to just close the file.
 
How it's your conficureations and acess to the mdb file? ________

George
 
Full access. The file is at the remote server. User can not access the server to use NET FILE ID /CLOSE.

I want to implement it in a script.

Thanks.
 
If your file is allready open u cannot close them cuz u don't opened the file...
________

George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top