Search found 553 matches
- 02 Jan 2023 08:53
- Forum: DOS Batch Forum
- Topic: How to loop through drive letters to run my script
- Replies: 16
- Views: 17880
Re: How to loop through drive letters to run my script
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...
- 02 Jan 2023 08:49
- Forum: DOS Batch Forum
- Topic: Help with if / loop and variables
- Replies: 9
- Views: 24277
Re: Help with if / loop and variables
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.
Saso
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.
Saso
- 30 Dec 2022 00:45
- Forum: DOS Batch Forum
- Topic: How to loop through drive letters to run my script
- Replies: 16
- Views: 17880
Re: How to loop through drive letters to run my script
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 ...
- 29 Dec 2022 05:14
- Forum: DOS Batch Forum
- Topic: How to loop through drive letters to run my script
- Replies: 16
- Views: 17880
Re: How to loop through drive letters to run my script
It will go thru all the letters in the FOR command and PAUSE after *each* letter.
Saso
Saso
- 27 Dec 2022 05:04
- Forum: DOS Batch Forum
- Topic: bat file to open workbook
- Replies: 1
- Views: 6498
Re: bat file to open workbook
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...
- 26 Dec 2022 11:03
- Forum: DOS Batch Forum
- Topic: How to loop through drive letters to run my script
- Replies: 16
- Views: 17880
Re: How to loop through drive letters to run my script
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...
- 23 Dec 2022 00:44
- Forum: DOS Batch Forum
- Topic: How to loop through drive letters to run my script
- Replies: 16
- Views: 17880
Re: How to loop through drive letters to run my script
'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...
- 20 Dec 2022 11:25
- Forum: DOS Batch Forum
- Topic: How to loop through drive letters to run my script
- Replies: 16
- Views: 17880
Re: How to loop through drive letters to run my script
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...
- 15 Dec 2022 06:35
- Forum: DOS Batch Forum
- Topic: How to loop through drive letters to run my script
- Replies: 16
- Views: 17880
Re: How to loop through drive letters to run my script
The code below will go thru letters C..Z:
Replace echo %%f with the code you want (for example: if exist %%f:\folder_to_file\file_to_check.tmp).
Saso
Code: Select all
@echo off
for %%f in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do echo %%f
Saso
- 07 Dec 2022 00:24
- Forum: DOS Batch Forum
- Topic: copy
- Replies: 12
- Views: 6461
Re: copy
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...
- 06 Dec 2022 07:48
- Forum: DOS Batch Forum
- Topic: copy
- Replies: 12
- Views: 6461
Re: copy
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...
- 05 Dec 2022 04:53
- Forum: DOS Batch Forum
- Topic: copy
- Replies: 12
- Views: 6461
- 05 Dec 2022 01:46
- Forum: DOS Batch Forum
- Topic: copy
- Replies: 12
- Views: 6461
Re: copy
viewtopic.php?f=3&t=6108
Maybe you could do this:
or
Saso
Maybe you could do this:
Code: Select all
help copy
Code: Select all
copy /?
- 29 Nov 2022 05:13
- Forum: DOS Batch Forum
- Topic: infinite loop with break condition
- Replies: 75
- Views: 97492
Re: infinite loop with break condition
Of course. Handle. The moment I turned the computer off I thought of that.
Thanks.
Saso
Thanks.
Saso
- 28 Nov 2022 13:46
- Forum: DOS Batch Forum
- Topic: infinite loop with break condition
- Replies: 75
- Views: 97492
Re: infinite loop with break condition
Very good findings, Jeb. I remembered that Aacini made a filepointer.exe. Original Steffen's code: @echo off &setlocal EnableDelayedExpansion set "n=0" &echo %time% & set /a "n+=1" :loop if !n! leq 10000 ( set /a "n+=1" ) else goto :exit goto :loop :exit echo %time% %n% &pause With filepointer.exe @...