I need to create a bat file to go moving the files from one folder to another while an application is running
Is there any command that can use a bat file to verify that the application is running
If the application is runing or not
Moderator: DosItHelp
-
- Posts: 233
- Joined: 21 Nov 2010 08:07
- Location: At My Computer
Re: If the application is runing or not
its call the program in use error and to close the application and try again
Re: If the application is runing or not
tasklist shows you if an application is running.
-
- Expert
- Posts: 976
- Joined: 15 Jun 2012 13:16
- Location: Italy, Rome
Re: If the application is runing or not
try :
this code start a batch file when a program start, in this example firefox.exe:
If you want that start even the program is alreay active then change "set /a st=3" with "set /a st=0"
einstein1969
this code start a batch file when a program start, in this example firefox.exe:
Code: Select all
@echo off & setlocal EnableDelayedExpansion & set /a st=3 & for /L %%i in (1,0,1) do ( ping ::1 >nul 2>nul & tasklist | find "firefox.exe" >nul && set /a "st=(st*2+1)&3" || set /a "st=(st*2)&3" & if !st! equ 1 call C:\file.bat )
If you want that start even the program is alreay active then change "set /a st=3" with "set /a st=0"
einstein1969