Run a .bat command with current file name as argument

Discussions on extending SharpCap using the built in Python scripting functionality
Post Reply
maropapa
Posts: 9
Joined: Sun Jan 24, 2021 3:00 pm

Run a .bat command with current file name as argument

#1

Post by maropapa »

Hi,

Is it possible to pass the current file name (or at least the working directory) to a batch file as an argument?

Run '<Program to run>' with parameters '<Arguments>' and <Wait for command to exit?>
The argument should refer to the current set of images.

Or is there any way to signal that one sequence was ended?

Best regards,
Tamas
User avatar
admin
Site Admin
Posts: 14257
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Run a .bat command with current file name as argument

#2

Post by admin »

Hi,

that can't be done with the sequencing engine, but may be possible with the Python scripting - for instance in scripting you can use

Code: Select all

  
print (SharpCap.GetLastCaptureFilename())
to see the last file saved by SharpCap - this may be sufficient to build what you need.

cheers,

Robin
maropapa
Posts: 9
Joined: Sun Jan 24, 2021 3:00 pm

Re: Run a .bat command with current file name as argument

#3

Post by maropapa »

Thanks Robin! That helps.
Post Reply