Search found 125 matches

by pstein
09 Sep 2017 12:10
Forum: DOS Batch Forum
Topic: Searching easy way to remove double quotes around parameters?
Replies: 5
Views: 6343

Re: Searching easy way to remove double quotes around parameters?

Hmm, I tried it again......and it works.

Must have been a bug in command interpreter the previous time

:-)

Thank you for the solution and sorry for the confusion
by pstein
09 Sep 2017 07:05
Forum: DOS Batch Forum
Topic: Searching easy way to remove double quotes around parameters?
Replies: 5
Views: 6343

Re: Searching easy way to remove double quotes around parameters?

Sorry no.

The problem is that %1 contains from the very beginning a double quotes string like

%1 = "D:\foo\bar\mypic.hpg"

This implicite assignment is not done by me but the WindowsOS when I drap a file onto the batch script

Any other idea?
by pstein
09 Sep 2017 03:01
Forum: DOS Batch Forum
Topic: Searching easy way to remove double quotes around parameters?
Replies: 5
Views: 6343

Searching easy way to remove double quotes around parameters?

I wrote a batch script which receives files with pathes as parameters. As set file=%1 echo processing %file% shows the file parameter is always enclosed in double quotes. How can I remove them in the most easy way (= a one liner)? Do I really have to use (two) substring operations on the variable? P...
by pstein
28 Aug 2017 04:43
Forum: DOS Batch Forum
Topic: How to delete all empty (sub)folders inside a dirtree?
Replies: 1
Views: 2155

How to delete all empty (sub)folders inside a dirtree?

Assume I have the following topnode dir of a directory tree: D:\tools\aaa\logs\ How can I delete all empty folders inside this topnode? If the current directory contains an empty sub directory recursively then this should be deleted first.... How can I achieve this from dos batch script? The top nod...
by pstein
12 Aug 2017 23:28
Forum: DOS Batch Forum
Topic: commands to change CmdPrompt buffer size?
Replies: 9
Views: 11248

Re: commands to change CmdPrompt buffer size?

Don't know nothing about Win 10, but here (Win8) under HKEY_CURRENT_USER\Console key, you may find ScreenBufferSize 0x012c0050 WindowSize 0x00190050 Both are DWORD values, where hiword is lines and loword is columns. So ScreenBufferSize.Lines is 0x012c (decimal 300) and ScreenBufferSize.Columns is ...
by pstein
11 Aug 2017 03:37
Forum: DOS Batch Forum
Topic: commands to change CmdPrompt buffer size?
Replies: 9
Views: 11248

commands to change CmdPrompt buffer size?

When I enter in a CmdPrompt under Win7 a command like mode con cols=80 lines=50 then the number of visible rows and columns are changed accordingly. This command seems not to work any longer in Win10. Is this true? Furthermore I am searching for a similar way to change (=increase) the current line/h...
by pstein
23 Apr 2017 04:02
Forum: DOS Batch Forum
Topic: How to adjust command to run in batch script?
Replies: 3
Views: 3528

How to adjust command to run in batch script?

I have got from some tutorials two commands which run perfect if entered manually at the command prompt (on 64bit Win7): FOR /F "Tokens=*" %A IN ('DIR /al /b /s D:\') DO @( for /F "Tokens=2,4 delims=<[]>" %B IN ('DIR /al "%~A"? ^| FIND /I " %~nA " ^| FIND /I &...
by pstein
15 Apr 2017 02:31
Forum: DOS Batch Forum
Topic: How to find out if a DOS batch script runs on Win 7 oder Win 10?
Replies: 2
Views: 3636

How to find out if a DOS batch script runs on Win 7 oder Win 10?

How do I find out if a DOS batch script runs on Win 7 oder Win 10?

Thank you
Peter
by pstein
13 Apr 2017 23:50
Forum: DOS Batch Forum
Topic: Execute a command every n seconds?
Replies: 6
Views: 5174

Execute a command every n seconds?

How can I execute (from a DOS batch script) a command every n (e.g. 5) seconds?

The command output should be shown at the command prompt "as usual".

This loop should be stoppable only by hitting Ctrl+C (or by closing the cmd.exe window by clicking the "x")

Peter
by pstein
09 Apr 2017 00:14
Forum: DOS Batch Forum
Topic: Open (second) cmdprompt, execute command and stay open?
Replies: 6
Views: 5619

Re: Open (second) cmdprompt, execute command and stay open?

Sounds like you have basically 0 free space in D:, which is horrifying to think about. Deleting files or moving them to another drive are your only options. When you run the cmd command, you are opening a brand new instance of the command prompt. There is no previous history to show; what you're as...
by pstein
08 Apr 2017 04:46
Forum: DOS Batch Forum
Topic: Open (second) cmdprompt, execute command and stay open?
Replies: 6
Views: 5619

Re: Open (second) cmdprompt, execute command and stay open?

It works. Thank you. But two more problems arise now: 1.) The opened Command prompt shows topmost a message: "Not enough storage is available to process this command" This warning/error appears even if I pass a simple command like "echo hello" Why? How do I increase storage? 2.) ...
by pstein
07 Apr 2017 03:19
Forum: DOS Batch Forum
Topic: Open (second) cmdprompt, execute command and stay open?
Replies: 6
Views: 5619

Open (second) cmdprompt, execute command and stay open?

From within a dos batch file I want to open a (second) command prompt, then execute a command in it and finally let the second cmdprompt stay open. The first cmdprompt should meanwhile continue to run. The following (simplified) code does NOT work (under 64bit Win7): set drive=D set logfile=mylogfil...
by pstein
20 Oct 2016 03:30
Forum: DOS Batch Forum
Topic: How to assign group values from regexp to multiple external DOS batch variables?
Replies: 4
Views: 5155

Re: How to assign group values from regexp to multiple external DOS batch variables?

Yes, I saw the suggestions of solutions. However since I wrote only a simplified scenario of my original problem I need time to adjust it accordingly. I am pretty surprised that this should work but I am optimistic. I don't forget ths Thread and appreciate your help. So thank you for now. I will rev...
by pstein
16 Oct 2016 03:11
Forum: DOS Batch Forum
Topic: How to assign group values from regexp to multiple external DOS batch variables?
Replies: 4
Views: 5155

How to assign group values from regexp to multiple external DOS batch variables?

Assume I want to loop over a large directory tree with thousands of files. Only those files should be picked up for further processing which match a regular expression like (.*)\((.*).(.*)\).log logfile for variant 34 (223.101).log So a file like should be matched. Furthermore an advanced difficulty...
by pstein
29 May 2016 13:47
Forum: DOS Batch Forum
Topic: List all files with filenames longer than 255 chars?
Replies: 11
Views: 8674

Re: List all files with filenames longer than 255 chars?

I want to rever to the code from @Aacini below. It works. However I need now a slight modification: How can I find all filenames with a length above 100 chars BUT this time the prepended path is not added. So the length calculation should be only for the filename(+extension) How do I have to modify ...