Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

start /wait not working in windows 10 in a batch file

this work in windows 7:

@echo off
start /wait calc
echo calc is over

but not in windows 10

why? and what works in windows 10?
The idea is of course to execute the line: echo calc is over once the GUI calc is closed!
 
Here, calc terminates immediately! That would explain START /WAIT finishing. Does calc keep running for you?
 
MikeTroubleshooter: I think the Calc app has changed. You may need to wait for CalculatorApp to open, then close.

Vincent: You may need to repair Calculator.

I think the bottom line in both cases is that Microsoft has taken what used to be a simple program and made it needlessly complex. It's just what they do.
 
Yes, apparently CALC.EXE (only 27KB) starts this one and exits.

Code:
C:\Program Files\WindowsApps\Microsoft.WindowsCalculator_10.1906.55.0_x64__8wekyb3d8bbwe\Calculator.exe
 
start /wait notepad doesn't work either. Another app that used to be simple.
 
Start /wait notepad works here on Windows10. Is notepad now a Microsoft Store app?. Nothing related to the store works here and I don't care.
 
I should point out that I'm running Windows 11, not Windows 10, so the details are going to differ. On my system, running Notepad.exe launches a different Notepad.exe and then exits. Is it a Windows Store app? I don't know, and I don't care either.

start /wait notepad++ on the other hand does exactly what I would expect.
 
If it were a store app I'd expect it to have a path similar to the one I posted.

Code:
C:\Program Files\WindowsApps\Microsoft.WindowsCalculator_10.1906.55.0_x64__8wekyb3d8bbwe\Calculator.exe

If it helps the OP, you could wait for it to start and stop like this.

Code:
do while %@isapp[calculator] == 0 ( delay /m 500 )
do while %@isapp[calculator] GT 0 ( delay /m 500 )
 
I'm still using the Windows 3.1 versions of calc.exe and notepad.exe

Code:
R:\>type u:\calc16.btm
@setlocal
@echo off
cdd e:\otvdm
start /pgm otvdmw.exe --app-name e:\dosbox\windows\calc.exe
endlocal

1763487900454.webp


Ref: Otvdm/winevdm

Joe
 
I have an EVAL alias (and an EVAL plugin command). I also have a TI-84 Plus right next to me. I never liked pushing keypad buttons with a mouse.
 
I also don't like pushing keypad buttons with a mouse.

I use the numeric keypad on the keyboard.

Joe
 
For command line calculations,
I use CMath from the @Charles Dye EditKeys Plugin.

Code:
CMath — Evaluate a math expression at the command line.

To evaluate a math expression, type a colon followed by the expression. Then press Enter:

:1+2*3
The answer, 7, will be displayed below your expression. It will also be saved to the environment variable ANS. You can use this variable in your next expression:

:ans*2
Just remember that the value of ANS changes every time you use CMath. After the second line, ANS will be 14, not 7.


CMath calls the same function that @EVAL uses internally. You can use any operator or function that is legal in @EVAL:

:log(100)

set r=4
:pi*r**2

:1492 =x

Ref: EditKeys Plugin

Joe
 
Back
Top