Lag with MS-DOS Batch Functions

I have been using Opus for a while not since version 9 with MS-DOS Batch Functions it always worked great and have executed fast. Now since I have installed the latest version I notice a pause before they actual run. There is some lag before the buttons I put them in actually run the command. The example below is how I am using them in buttons. They used to launch the program split second and now they wait like four seconds when I press the button. Does anybody have any insight on this? Thanks

@echo off
chcp 1252 > nul
C:
cd "C:\Program Files (x86)\Notepad++"
start notepad++.exe {filepath}

Do you get the same lag when opening a command prompt?

Are you in a UNC network path when you run the button?

(FWIW, the example button does not need to be an MS DOS button at all.)

Thanks that is good to know, I mean I would like to know the most efficient way to run the command. Could you show me the way to take the example I had and put it in a more efficient Opus way to execute it. I think once I see it I will bee off and running to do these commands on my own. I am sure you can see that all it dose is use the Batch command to launch the selected file with the program ( in this case Notepad++) of choice.

This should be all you need, with the type set to Standard Function:

"C:\Program Files (x86)\Notepad++\notepad++.exe" {filepath}

If you need more help, please link your account.

Thanks the way you suggested works great seems more efficient also. It does not popup a DOS window quickly to execute. I don't want to know that something in my system is not working correctly though. What I mean is I am wondering why that lag started happening all of the sudden. I have been using it the same for over a year. I did change out my hard drive? I am just mentioning all this, and don't expect specific to my system changes to be addressed or understood. Back to the way I used the Batch commands, that works great for one program launching a file but I used to always (for testing things like web code) do this (below). How could multiple programs be launched with the same file? I tried to stack the lines like you showed me, and it launches each in order after I close the current, not at the same time which is what I want.

@echo off
chcp 1252 > nul
C:
cd "C:\Program Files (x86)\Mozilla Firefox"
start firefox.exe {filepath}
cd "C:\Program Files (x86)\Notepad++"
start notepad++.exe {filepath}
cd "C:\Program Files (x86)\Google\Chrome\Application"
start chrome.exe {filepath}
cd "C:\Program Files (x86)\Safari"
start Safari.exe {filepath}
cd "C:\Program Files (x86)\Internet Explorer"
start iexplore.exe {filepath}

[ul][li]To launch multiple external commands at once directly (without using a DOS Batch), and without waiting for each one to finish, add @async: to the start of each line.

For example:

@async:"C:\Program Files (x86)\Notepad++\notepad++.exe" {filepath}
@async:"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" {filepath}


[/li]
[li]If you want to track down why the Command Prompts are slow to open now, please answer my questions in my first reply, above.[/li][/ul]

Do you get the same lag when opening a command prompt? - No, it is fast and normal.
Are you in a UNC network path when you run the button? - No.

PHPBB_IMPORT_WARNING CODE_NEAR_LI

Thanks.

Some other things that might be worth checking:

[ul][li]If you use Tools -> Command Prompt Here in Opus, is that as fast as opening a command prompt via the Windows Start Menu?

(Maybe it's only when Opus opens the prompts, for some reason. Something set within the process or maybe how antivirus treats different processes.)


[/li]
[li]Does this really simple DOS Batch button also cause a delay?

echo Test Pause


[/li]
[li]If you put the same two commands (echo and pause) into a .bat file, then double-click the .bat file in Opus, is there a similar delay?

[/li]
[li]What about if you double-click the same .bat file in Explorer?

[/li]
[li]If none of those cause a delay, try putting this into a .bat file and double-clicking it in both Explorer and Opus:

@echo off chcp 1252 > nul C: cd "C:\Program Files (x86)\Mozilla Firefox" start firefox.exe "C:\path\to\your\example\webpage.html"

(Change the path at the end appropriately, of course; but keep it in quotes if it contains a space.)[/li][/ul]

Hopefully some of those will show a similar delay, and that might point us in the right direction.

Yes it cause a delay (I put it in an opus button).

No, it is runs super fast.

It runs super fast there as well.

Both are super fast, no delay.

I took it upon myself to also drag the second .bat up as a button to see how it fired and it is super a fast also. I just dragged it on to the bar. Don't know if that helps.

By the way the @async works great for multiple commands. Thanks, you guys support is fabulous. Directory Opus is a program that does not stop giving, this is rear these days!

That's quite strange, that the delay does not happen when launching a .bat file in any other way. There isn't a lot that happens when DOS Batch function gets run.

Opus will write a .bat file to your temp directory. (Anti-virus may be causing a problem there? Or something wrong with the temp directory or drive it's on itself?)

Opus will then do the equivalent of double-click the .bat file from the temp directory. (There are things which can go wrong there, but then they'd probably also go wrong when double-clicking it normally.)

I guess it might be worth a try checking if you get a delay with any of the earlier test .bat files copied to the temp folder (type /temp into Opus to locate the right folder).

Maybe the best thing to do is run Process Monitor and see what's going on during that delay.