Jump to content

Recommended Posts

Posted

HELLO

How i can wait until process close then wait for file delete and then go for copy

ProcessClose("autoit.exe")

FileDelete(@SystemDir & "\autoit.exe")

FileCopy(d:\Newautoit.exe",  @SystemDir & "\NewAutoit.exe")

Posted (edited)

The help says the ProcessClose returns none

try something like

ProcessClose("autoit.exe")
$PID = ProcessExists("autoit.exe")
While $PID
   Sleep (1000)
   $PID = ProcessExists("autoit.exe")
   if $PID then
     ProcessClose($PID)
   endif
Wend

or

ProcessClose("autoit.exe")
$PID = ProcessExists("autoit.exe")
if $PID then
   ProcessWaitClose($PID)
endif
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Posted

While FileExists("somefile.txt")

FileDelete("somefile.txt")

WEnd

Or you can compile the FileDelete() into a separate exe and do a RunWait.

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Posted (edited)

There are many ways you could do this, but I would do something like...

$Program_1 = "blah.exe"
$Program_2 = "test.exe"
$Program_3 = "blahblah.exe"

$Kill_Process = StringSplit($Program_1 & "," & $Program_2 & "," & $Program_3, ",")

For $I = 1 To $Kill_Process[0]
   ProcessClose($Kill_Process[$I])
Next
Edited by Burrup

qq

Posted

HELLO

PLZ tell me easy way to put multi process your example works fine but need lots of type if process list more then 250 is there any to put list single line NOT LIKE $Program_1 = "blah.exe" AND then add

StringSplit in this take more time to and take more space so i want to know single line addition way for multi process kill

$Program_1 = "blah.exe"

$Program_2 = "test.exe"

$Program_3 = "blahblah.exe"

$Kill_Process = StringSplit($Program_1 & "," & $Program_2 & "," & $Program_3, ",")

For $I = 1 To $Kill_Process[0]

  ProcessClose($Kill_Process[$I])

Next

like webpage keyword added blah, blah.com etc it easy way to add

<{POST_SNAPBACK}>

If you dont want his advice then figure it out. He offered you the best way to do it. Now if you want another way it is right in his example. You can skip one step.

Just do...

$Kill_Process = StringSplit("blah.exe,test.ext,blahblah.exe,testtest.exe,blahtest.exe,etc.exe", ",")

Just some thoughts,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Posted

@ asimzameer :

Untested, but something like this might work :

$stopservice = StringSplit("SharedAccess,wscsvc", ",")

For $i = 1 To $stopservice[0]
    Sleep(10)
    RunWait(@ComSpec & " /c " & "net.exe stop " & $stopservice[$i],"",@SW_HIDE)
Next

Good luck !

-Helge-

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...