473,473 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Close files opened by another app

I've just had a colleague ask me this one: is it possible to close
files opened (and left open) by another app, programatically? I know
it must be possible because NET FILE can do it as can Computer
Management.

I can't find an obvious place to start in .NET - is there one? I came
to .NET via scripting and haven't ever done Win32 stuff. Can anyone
point me towards a place to start?

Cheers

SSG

Aug 8 '06 #1
3 4774
If NET FILE will do what you want, then you can just call that on the command
line from your app via Process.Start.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"ssg31415926" wrote:
I've just had a colleague ask me this one: is it possible to close
files opened (and left open) by another app, programatically? I know
it must be possible because NET FILE can do it as can Computer
Management.

I can't find an obvious place to start in .NET - is there one? I came
to .NET via scripting and haven't ever done Win32 stuff. Can anyone
point me towards a place to start?

Cheers

SSG

Aug 8 '06 #2
Hi,

I dont think this is possible. at least with managed code.

Of course if you find a method to force win to release the handle of that
file then the file will be considered "closed" and you can open it. Not sure
how to do this (even if possible) though.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"ssg31415926" <ne**********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
I've just had a colleague ask me this one: is it possible to close
files opened (and left open) by another app, programatically? I know
it must be possible because NET FILE can do it as can Computer
Management.

I can't find an obvious place to start in .NET - is there one? I came
to .NET via scripting and haven't ever done Win32 stuff. Can anyone
point me towards a place to start?

Cheers

SSG

Aug 8 '06 #3
Thanks. Yes, I could do that but it's not very nice! I was hoping for
something a bit more elegant! Yes, I know, if it works...

SSG

Peter wrote:
If NET FILE will do what you want, then you can just call that on the command
line from your app via Process.Start.
Peter

--
Aug 9 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Sujan | last post by:
Hello all, Help me! -------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <script language="JavaScript"> <!--
0
by: EMW | last post by:
Hi, In my ASPX program in a OnClick event another IE window is opened to show the user some information. I have smartnavigation enabled to reduce the flickering and now I get an error. This...
7
by: Paul | last post by:
Hi I have a web application that has a log off selection, just redirects the browser to a form with a label displaying you are loging off. In part of the application I open a new window and was...
14
by: T | last post by:
Do I need to close the file in this case? Why or why not? for line in file('foo', 'r'): print line
6
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I close a window and why does it not work on the first one?...
1
by: G Gerard | last post by:
Hello I have written some help files using Html Help Workshop version 4.74.8702 I use the following code to launch the chm file Declare Function HtmlHelp Lib "HHCtrl.ocx" Alias "HtmlHelpA" _...
3
by: godhulirbalaka | last post by:
Dear Sir/Madam, I am new vb 6.0 user. I am developing Shop Management Program. I have a main form with buttons and menus. when i click any button then respective form is open. I want to set a...
2
by: BAnderton | last post by:
Greetings from beautiful Tucson, Arizona. Question: Is there a way in Python to determine what all file identifiers have been opened by Python, and to close them all? Why I ask: I learned...
6
by: =?Utf-8?B?UGF1bA==?= | last post by:
I am looking for a java script to close a web form that I can attatch to a button click event. I am using vs2005, c#. Thanks -- Paul G Software engineer.
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.