7

I'm relatively new to batch commands and have been learning steadily. My problem is like this:

I've understood how to kill processes using batch commands using many different methods. However, I've been unable to figure out how to close a single tab in, preferably, chrome.

Any thoughts would be greatly appreciated! Thanks!


So, I suppose I should state my exact problem.

I'm using notepad++ as my LaTeX compiler and sending the final pdf to chrome. The reason: I usually have ~20 tabs open related to the project I'm working on and it just makes my work much easier to split my screen between notepad++ and chrome. My current batch file compiles the LaTeX code and sends the compiled document to chrome as a new tab. For obvious reasons, i don't want to close a tab each time I compile, so I thought that closing the current tab at the same time during compiling would solve my problem. But, I just can't find a way to get my batch file to only close the tab with my compiled pdf.

Thanks in advance!

fiziks
  • 247
  • 2
  • 5

1 Answers1

4

check all running chrome instances/tabs with :

wmic process where "caption='chrome.exe'" get

and see processes properties.Probably the best indicator that you can rely on in this case is CreationDate (other properties are basically the same for all chrome instances) - it always comes in format YYYYMMDDHHmmss.ms and is easy for string comparison.But you'll have to know the time when it was started.

npocmaka
  • 55,367
  • 18
  • 148
  • 187