User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » question about simple windows batch file. Page [1]  
Chop
All American
6271 Posts
user info
edit post

what is the syntax to close/exit a program that's running? my batch file looks something like this:

:begin
file1.wmv
file2.wmv
goto begin

at the end of file1, i have to manually close wmplayer, then file file2 starts automatically. how do i avoid having to close wmplayer automatically?

4/8/2006 9:52:12 PM

stowaway
All American
11770 Posts
user info
edit post

??

what are you trying to do? have one file start after the first one ends?

i'd think a playlist in wmp would be a better idea

[Edited on April 8, 2006 at 10:04 PM. Reason : ]

4/8/2006 10:03:43 PM

Chop
All American
6271 Posts
user info
edit post

its for a tradeshow presentation. its actually several different file formats, i can't put everything in wmplayer, that was just used as an example. basically, i just want to know how to close an application from the command line.

4/8/2006 10:19:09 PM

Noen
All American
31346 Posts
user info
edit post

if its for a tradeshow presentation, you should put everything into a single entity.

Whether that's a wmv, dvd, powerpoint or whatever, it's way more professional looking

4/8/2006 10:23:05 PM

Chop
All American
6271 Posts
user info
edit post

can someone just answer the question?

if not, does anyone know a way to get carsim video exe's into a format that can be used in a video editor? carsim doesn't export to mpeg's, avi's, etc. (i'd actually be surprised if anyone here has ever even used carsim before).

basically, i just want to know how to close an application from the command line.

[Edited on April 8, 2006 at 10:37 PM. Reason : .]

4/8/2006 10:37:02 PM

kinetix
All American
3122 Posts
user info
edit post



[Edited on April 8, 2006 at 11:18 PM. Reason : ]

4/8/2006 11:18:00 PM

joe17669
All American
22728 Posts
user info
edit post

TASKKILL [/S system [/U username [/P [password]]]]
{ [/FI filter] [/PID processid | /IM imagename] } [/F] [/T]

Description:
This command line tool can be used to end one or more processes.
Processes can be killed by the process id or image name.

Parameter List:
/S system Specifies the remote system to connect to.

/U [domain\]user Specifies the user context under which
the command should execute.

/P [password] Specifies the password for the given
user context. Prompts for input if omitted.

/F Specifies to forcefully terminate
process(es).

/FI filter Displays a set of tasks that match a
given criteria specified by the filter.

/PID process id Specifies the PID of the process that
has to be terminated.

/IM image name Specifies the image name of the process
that has to be terminated. Wildcard '*'
can be used to specify all image names.

/T Tree kill: terminates the specified process
and any child processes which were started by it.

/? Displays this help/usage.

Filters:
Filter Name Valid Operators Valid Value(s)
----------- --------------- --------------
STATUS eq, ne RUNNING | NOT RESPONDING
IMAGENAME eq, ne Image name
PID eq, ne, gt, lt, ge, le PID value
SESSION eq, ne, gt, lt, ge, le Session number.
CPUTIME eq, ne, gt, lt, ge, le CPU time in the format
of hh:mm:ss.
hh - hours,
mm - minutes, ss - seconds
MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB
USERNAME eq, ne User name in [domain\]user
format
MODULES eq, ne DLL name
SERVICES eq, ne Service name
WINDOWTITLE eq, ne Window title

NOTE: Wildcard '*' for the /IM switch is accepted only with filters.

NOTE: Termination of remote processes will always be done forcefully
irrespective of whether /F option is specified or not.

Examples:
TASKKILL /S system /F /IM notepad.exe /T
TASKKILL /PID 1230 /PID 1241 /PID 1253 /T
TASKKILL /F /IM notepad.exe /IM mspaint.exe
TASKKILL /F /FI "PID ge 1000" /FI "WINDOWTITLE ne untitle*"
TASKKILL /F /FI "USERNAME eq NT AUTHORITY\SYSTEM" /IM notepad.exe
TASKKILL /S system /U domain\username /FI "USERNAME ne NT*" /IM *
TASKKILL /S system /U username /P password /FI "IMAGENAME eq note*"

4/8/2006 11:29:32 PM

LimpyNuts
All American
16859 Posts
user info
edit post

^your response isnt going to do him any good because the TASKKILL command is not going to run until after he closes WMP. what he wants is for his batch file to continue execution without pausing for each command to finish (then he could kill it if he wanted to)

you can't because:

:begin
command1
command2
goto begin


when command1 is run, it is run modally, meaning the batch file can not continue to execute until the command exits or is terminated. i don't think you can run commands in parallel in a batch file, but maybe you can. anyway, if you did, the thing would launce the 2 processes over and over again until the computer crashed. is that what you want?

[Edited on April 8, 2006 at 11:36 PM. Reason : ]

4/8/2006 11:32:40 PM

stowaway
All American
11770 Posts
user info
edit post

output each video into a video capture card and then edit all of the videos into one file, play in favorite media player set to repeat.




lol, guess the mustang couldn't stop in time

[Edited on April 8, 2006 at 11:35 PM. Reason : ]

4/8/2006 11:33:54 PM

Noen
All American
31346 Posts
user info
edit post

Chop: its because those EXE's arent video, they are actual model simulations.

So run it and use http://www.fraps.com/ to get video from it.

And to answer the question, you cant

4/8/2006 11:37:31 PM

joe17669
All American
22728 Posts
user info
edit post

^^^ I see now that it won't work in his situation, but it did answer his question: basically, i just want to know how to close an application from the command line.

4/8/2006 11:49:12 PM

Chop
All American
6271 Posts
user info
edit post

yeah, i know they're model simulations and not video, that's what i was trying to say earlier. you can run the animations external to carsim, and even play several back to back with said batch file. i was trying to use a similar technique to play a carsim video back to back with video of the actual vehicle tests. i was surprised to find you can't just kill the wmplayer though.

i was up at the SAE show last week and talked to the guys that did the the simulations for that motor trend article. they even let me drive the simulation of the new camaro. pretty cool.

4/9/2006 12:39:47 AM

smoothcrim
Universal Magnetic!
18966 Posts
user info
edit post

http://www.ss64.com

4/9/2006 2:14:20 AM

kylekatern
All American
3291 Posts
user info
edit post

batch file a
:begin
batch1
wait time
batch2
wait time

You jsut have to do it with somehting other than a batch file, oyu need paralele execution, i have never seen a way to do that with jsut a btch file. Possibly look at using a program schedule software to run each sim, then run the taskkiller commands? I have used freebie run software at time x type setups to do a power point loop that allowed user interaction with a web page between loops. Just takes some playing, and timing the next video jsut right.

4/9/2006 8:31:48 AM

 Message Boards » Tech Talk » question about simple windows batch file. Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.