Search found 562 matches

by miskox
07 Jun 2023 23:44
Forum: DOS Batch Forum
Topic: cmd-Terminal menu: How to iterate a number of spaces given in a variable into another variable?
Replies: 5
Views: 1794

Re: cmd-Terminal menu: How to iterate a number of spaces given in a variable into another variable?

You could use something like this: @echo off set text1=Some text&rem set text2=Some more text&rem set text3=Additional text&rem set field1=%text1% &rem 20 spaces set field2=%text2% &rem 25 spaces set field3=%text3% &rem 30 spaces set field1=%field1:~0,20% set field2=%field2:~0,25% set field3=%field3...
by miskox
03 Jun 2023 13:26
Forum: DOS Batch Forum
Topic: Combinations of N numbers in sets of K with R repeated elements
Replies: 9
Views: 3623

Re: Combinations of N numbers in sets of K with R repeated elements

Congratulations Antonio! I must admit that I don't understand what are you talking (writing) about but it was an interesting to read it. I am always amazed with the solutions you have (I remember that clever solution for that very loooong XML schema https://www.dostips.com/forum/viewtopic.php?f=3&t=...
by miskox
05 May 2023 07:07
Forum: DOS Batch Forum
Topic: create macro: Let's create a small handout with reports .
Replies: 17
Views: 5566

Re: create macro: Let's create a small handout with reports .

2jeb: thank you for this looong post of useful links. I will take a look at them too. I am having troubles understanding macros aswell. Will check them. I think it is time for me to try and use them.

Saso
by miskox
04 May 2023 06:55
Forum: DOS Batch Forum
Topic: Notepad bug
Replies: 10
Views: 9804

Re: Notepad bug

https://answers.microsoft.com/en-us/windows/forum/all/notepadexe-command-line-options/810760c1-a45a-4013-9544-1c1208e1b389 /A <filename> open file as ansi /W <filename> open file as unicode /P <filename> print filename /PT <filename> <printername> <driverdll> <port> print filename to designated prin...
by miskox
23 Mar 2023 12:27
Forum: DOS Batch Forum
Topic: Read window line from parent cmd without writing to file
Replies: 6
Views: 2674

Re: Read window line from parent cmd

Run pmon.exe only and post the results (between code tags, please).

Saso
by miskox
23 Mar 2023 06:24
Forum: DOS Batch Forum
Topic: Read window line from parent cmd without writing to file
Replies: 6
Views: 2674

Re: Read window line from parent cmd

What happens if you remove the 'start' command?

Code: Select all

for /f "usebackq tokens=2 delims=: " %i in (`pmon.exe ^|findstr /i "memory"`) do echo %i
Saso
by miskox
28 Feb 2023 06:41
Forum: DOS Batch Forum
Topic: If Exist then Delete
Replies: 1
Views: 1327

Re: If Exist then Delete

Add

Code: Select all

del /f /q F:\Finances\CSOB\XLK_WorkSheets2023\*.xlk
if you want to delete files first.

Saso
by miskox
08 Jan 2023 10:16
Forum: DOS Batch Forum
Topic: Exporting two keys from Registry residing in two different places on Windows 10
Replies: 9
Views: 17155

Re: Exporting two keys from Registry residing in two different places on Windows 10

Some changes to Lucky's solution: @echo off reg export "HKEY_CURRENT_USER\Console" "%userprofile%\Documents\CMD _ PowerShell Settings.reg" reg export "HKEY_USERS\S-1-5-21-3797103458-798797042-3558267449-1001\Console" "%userprofile%\Documents\1.reg" type "%userprofile%\Documents\1.reg" | find /v "Win...
by miskox
05 Jan 2023 05:23
Forum: DOS Batch Forum
Topic: How to loop through drive letters to run my script
Replies: 16
Views: 18400

Re: How to loop through drive letters to run my script

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...
by miskox
02 Jan 2023 08:53
Forum: DOS Batch Forum
Topic: How to loop through drive letters to run my script
Replies: 16
Views: 18400

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...
by miskox
02 Jan 2023 08:49
Forum: DOS Batch Forum
Topic: Help with if / loop and variables
Replies: 9
Views: 26435

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
by miskox
30 Dec 2022 00:45
Forum: DOS Batch Forum
Topic: How to loop through drive letters to run my script
Replies: 16
Views: 18400

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 ...
by miskox
29 Dec 2022 05:14
Forum: DOS Batch Forum
Topic: How to loop through drive letters to run my script
Replies: 16
Views: 18400

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
by miskox
27 Dec 2022 05:04
Forum: DOS Batch Forum
Topic: bat file to open workbook
Replies: 1
Views: 6640

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...
by miskox
26 Dec 2022 11:03
Forum: DOS Batch Forum
Topic: How to loop through drive letters to run my script
Replies: 16
Views: 18400

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...