Articles

Solved Batch Files / Automation Response

December 12, 2012 at 15:15:53
Specs: Windows 7

I have multiple spreadsheets across multiple servers shared by a dozen users. The Excel INDIRECT function requires that a linked file be open in order to update the data.

I have written a batch file to open the linked source files and my summary file so they can all update daily. 2 of the source files generate a pop-up message when opening that interrupt the process.

How can I make a batch file output a simple "Y" (yes) to the message box to avert this?

Thank you,
Jason in Everett


See More: Batch Files / Automation Response

Report •


#1
December 12, 2012 at 17:56:07

as far as I know (which isn't very far!) you can't with plain batch. I'm clueless about powershell - maybe it can. vbscript can, using sendkeys method - it's kind of clumsy, but usually works ok. If you post the script you're using to open the files, and the msgbox msg content, someone smarter than me might get you into the ballpark.

Report •

#2
December 13, 2012 at 11:14:14

I don't believe you can in batch without some sort of third party intervention.

VBScript has SendKeys, so you could use that to emulate keyboard controls.

PowerShell gives you access to a C# compiler, and though that you can access the Win32 API. It's not pretty, but anything you can do programmatically, you can do with PowerShell. This includes finding the buttons in question and sending BM_CLICK messages.

The better question is what are these pop-ups, and what can you do to prevent them from popping up?

How To Ask Questions The Smart Way


Report •

#3
December 13, 2012 at 13:26:32
✔ Best Answer

Thanks. The pop ups were being caused by a formatting enforcement. I went back to the source and had the format of the reports changed, and this seems to have solved my problem.


Report •

Related Solutions


Ask Question