el proceso no tiene acceso al archivo porque esta siendo utilizado por otro proceso

1,760 views
Skip to first unread message

Luis Mata

unread,
Oct 20, 2010, 10:04:25 AM10/20/10
to publice...@googlegroups.com
Srs.
 
Como evito este error:
 
"el proceso no tiene acceso al archivo porque esta siendo utilizado por otro proceso"
 
que comando cierra archivos abiertos en memoria
 
Luis

Hugo C.

unread,
Oct 20, 2010, 12:54:14 PM10/20/10
to Comunidad de Visual Foxpro en Español
Si te refieres a matar procesos,
checa esto :

LOCAL objWMIService, objProcess, colProcess
LOCAL strComputer, strProcessKill
strComputer = "."

RUN /n calc.exe && Iniciamos la calculadora

strProcessKill = "'calc.exe'" && Proceso a eliminar

objWMIService = GetObject("winmgmts:" +
"{impersonationLevel=impersonate}!\\" + strComputer + "\root\cimv2")
colProcess = objWMIService.ExecQuery ("Select * from Win32_Process
Where Name = " + strProcessKill )
For Each objProcess in colProcess
objProcess.Terminate()
EndFor
? "Proceso eliminado " + strProcessKill + " en " + strComputer

Saludos.

On 20 oct, 08:04, "Luis Mata" <lm...@cclf.com.pe> wrote:
> ?Srs.

Hugo C.

unread,
Oct 20, 2010, 1:23:22 PM10/20/10
to Comunidad de Visual Foxpro en Español
Checa esto del comando CLEAR

RESOURCES [ FileName]


Specifies the name of a cached bitmap, picture, font, cursor, or icon
file to be cleared from memory. If no file name is specified, all
bitmap, picture, font, cursor and icon files are removed from memory.
When Visual FoxPro displays a bitmap, picture, cursor, icon, or font
resource, the resource is cached to optimized performance. If a
resource of the same name is used (for example, a different bitmap
with the same name as one already cached), Visual FoxPro does not
reload the resource. Clearing a resource file is therefore
particularly useful for removing a graphic image from memory and
forcing Visual FoxPro to reload an image of the same name from disk.
For example, a report might display graphic images from a database,
all of which are named TEMP; however, because they all have the same
name, Visual FoxPro will not reload each new graphic unless the
existing one has been cleared from memory using the CLEAR RESOURCES
command. If a particular resource is still in use by Visual FoxPro,
then it may not able to be cleared using the CLEAR RESOURCES command.

Saludos.



On 20 oct, 08:04, "Luis Mata" <lm...@cclf.com.pe> wrote:
> ?Srs.
>
Reply all
Reply to author
Forward
0 new messages