Here we see that both scripts are there. Go to command prompt and type: E:\Dropbox\AHK\AutoHotKey.ahk (and press RETURN) What happens? Does it return to the prompt immediately (while the script is still running)? E:\Dropbox\AHK\TextExpansion.ahk (and press RETURN) Is everything as expected? Create n...
I suspect that your second .ahk file is not there (I guess you don't check for the existence of both .ahk files). Please execute this and provide the output: test.cmd: @echo off for %%f in (C D E F) do echo ---&dir %%f:\Dropbox\AHK\Autohotkey.ahk&dir %%f:\Dropbox\AHK\TextExpansion.ahk pause You coul...
I agree with aGerman: user enters the data and all you have to do is use FIND or FINDSTR and check for ERRORLEVEL (or && / ||).
This is what you get for not providing all the information in the first place - solution to your problem might be completely different from your first approach.
Again: see my previous posts: Errors you have are caused because path you have does not exist on every device you have. So you have to use the first version which checks the existence of the files. It is possible that .ahk runs and does not wait until it finishes? (I don't know how .ahk works) This ...
You could try this (based on the info I have): Create run_xlsB.cmd (or name it as you wish) in the same folder where your .xlsb files are: @for /f "usebackq" %%f in (`dir /on /b *.xlsb`) do %%f or @for /f "usebackq" %%f in (`dir /on /b *.xlsb`) do start "" %%f See HELP CMD for other options if requi...
Add PAUSE at the end (looks like you double-click on the .cmd/.bat): @for %%f in (C D E F) do echo ---&dir %%f:\Dropbox\AHK\Autohotkey.ahk&dir %%f:\Dropbox\AHK\TextExpansion.ahk&pause If you execute (start) your .ahk file from within the command prompt: does it return to the prompt before it actuall...
'DO' is part of the FOR command and is required: enter FOR /? and you will see: Runs a specified command for each file in a set of files. FOR %variable IN (set) DO command [command-parameters] %variable Specifies a single letter replaceable parameter. (set) Specifies a set of one or more files. Wild...
I don't know how AHK works (their syntax and how you call the scripts) but I guess you could use something like this: This code will check if both .ahk files exist. If *both* exist it will first run first .ahk file and then the second one. @for %%f in (C D E F) do if exist %%f:\Dropbox\AHK\Autohotke...
Let me give you this link again: https://www.dostips.com/forum/viewtopic.php?f=3&t=6108 We are all wasting our time because your original post does not (and additional posts) provide enough information. You would probably already have a solution if your original post had all the information required...
What happens if you execute your .bat file? (of course remove BOLD tags) @echo off setlocal enabledelayedexpansion for %%A in (*.bat) do ( for /f "delims=" %%B in ("%%A") do set fname=%%~nB for /f "delims=" %%C in ("%%A") do set fextn=%%~xC for /f "tokens=1* delims=_" %%D in ("!fname!") do set folna...