Search found 3708 matches

by aGerman
09 Mar 2020 13:58
Forum: DOS Batch Forum
Topic: Tiemout in a for loop
Replies: 2
Views: 676

Re: Tiemout in a for loop

I can not use 'start' for calculate.exe which would open n windows for each req file. At least you have to use the START command (perhaps START /B) to run your tool asynchronously. Otherwise the timeout command would not be called before calculate.exe has finished. Untested: set "beginning=file_" s...
by aGerman
05 Mar 2020 11:17
Forum: DOS Batch Forum
Topic: mshta command for copy into clipboard
Replies: 10
Views: 1494

Re: mshta command for copy into clipboard

You said I didn't use event management well, what do you mean? Can you give me an example? Have a look at this: https://stackoverflow.com/questions/36270886/event-clipboarddata-setdata-in-copy-event But I can't tell what you have to do to make it work in a command line. Probably too much of code an...
by aGerman
04 Mar 2020 17:52
Forum: DOS Batch Forum
Topic: mshta command for copy into clipboard
Replies: 10
Views: 1494

Re: mshta command for copy into clipboard

Try to write the onclick property like that: onclick="clipboardData.setData('text','1')" Note that JScript is case-sensitive. Thus, something like ClipBoardData doesn't exist. However, that's still only a guess and certainly doesn't meet the standard way where you should have used an event handler i...
by aGerman
02 Mar 2020 14:25
Forum: DOS Batch Forum
Topic: Extract each whole line that contains a specific word.
Replies: 8
Views: 1399

Re: Extract each whole line that contains a specific word.

Sorry to be cheeky, but is there any way that I can get it to keep the original file name [ C:\Users\System-Admin\Desktop\MyFile ] so when it extracts the data it saves it as the original file name with a suffix of .txt please? All we know so far from your code is that you write both the input and ...
by aGerman
02 Mar 2020 13:23
Forum: DOS Batch Forum
Topic: Extract each whole line that contains a specific word.
Replies: 8
Views: 1399

Re: Extract each whole line that contains a specific word.

But in this case you definitely don't need the FOR loop. Just redirect the output of FINDSTR

Code: Select all

>"C:\Users\System-Admin\Desktop\wccfTrueOutput.txt" findstr "\<true\>" "C:\Users\System-Admin\Desktop\MyFile.wccf"
Steffen
by aGerman
02 Mar 2020 12:05
Forum: DOS Batch Forum
Topic: wsx.bat: REPL, one line program processor supporting some NodeJS features
Replies: 12
Views: 1735

Re: wsx.bat: REPL, one line program processor supporting some NodeJS features

After you told me that I just have to pass the files at the end of the command line it was all clear to me. But when I initially read the help message I couldn't figure out that [arguments] is related to the files that should be processed. So, it's of course not an issue of the functionality of the ...
by aGerman
02 Mar 2020 11:36
Forum: DOS Batch Forum
Topic: Extract each whole line that contains a specific word.
Replies: 8
Views: 1399

Re: Extract each whole line that contains a specific word.

Something like that probably

Code: Select all

findstr "\<true\>" "MyFile.wccf"
and if you have to process these lines in a loop then

Code: Select all

for /f "delims=" %%i in ('findstr "\<true\>" "MyFile.wccf"') do echo %%i
Steffen
by aGerman
01 Mar 2020 06:38
Forum: DOS Batch Forum
Topic: Help | Hey can some one help me to eddit a .ini file automatic from cmd
Replies: 3
Views: 1128

Re: Help | Hey can some one help me to eddit a .ini file automatic from cmd

Your code has nothing to do with what I told you. ECHO redirection means that you need the ECHO command. Carefully read and try again.

Steffen
by aGerman
01 Mar 2020 05:34
Forum: DOS Batch Forum
Topic: Help | Hey can some one help me to eddit a .ini file automatic from cmd
Replies: 3
Views: 1128

Re: Help | Hey can some one help me to eddit a .ini file automatic from cmd

Just use ECHO redirection. The operators > and >> both create a new file if it doesn't exist. But while > overwrites an existing file, >> appends to it. So, the piece of code to write your ini file could either look like that >"test.ini" echo Computer IP=%X% >>"test.ini" echo Port=%M% or >"test.ini"...
by aGerman
01 Mar 2020 05:22
Forum: DOS Batch Forum
Topic: wsx.bat: REPL, one line program processor supporting some NodeJS features
Replies: 12
Views: 1735

Re: wsx.bat: REPL, one line program processor supporting some NodeJS features

Not such a big problem. Only for people that never used the tool and try to figure out how it works. If you run wsx /? you'll get [...] Syntax: wsx.bat?.wsf [/help] [/version] [/dry-run] [/quiet] [/use:value] [/m:value] [/let:value] [/set:value] [/get:value] [/e:value] [/n] [/p] [/begin:value] [/end...
by aGerman
29 Feb 2020 10:19
Forum: DOS Batch Forum
Topic: wsx.bat: REPL, one line program processor supporting some NodeJS features
Replies: 12
Views: 1735

Re: wsx.bat: REPL, one line program processor supporting some NodeJS features

Oh, I see. I was somehow afraid that this would be treated as to belonging to the /e: option then :lol: Sorry for my ignorance.

Steffen
by aGerman
29 Feb 2020 05:16
Forum: DOS Batch Forum
Topic: wsx.bat: REPL, one line program processor supporting some NodeJS features
Replies: 12
Views: 1735

Re: wsx.bat: REPL, one line program processor supporting some NodeJS features

This tool seems to be quite handy. Just one question before I try to dive in a little deeper - where does the file come from in your examples? It seems to be reading from stdin in the first place. So, provided I'd like to print the first 10 lines of "test.txt" how do I do that?

Steffen
by aGerman
28 Feb 2020 11:12
Forum: DOS Batch Forum
Topic: How to replace extension of a filename stored in variable?
Replies: 6
Views: 1520

Re: How to replace extension of a filename stored in variable?

If I see this kind of code I'm always wondering what the advantage of defining an additional environment variable actually is. You already have the value in the FOR variable which keeps being valid as long as you use it inside of the body of the loop.

Steffen
by aGerman
28 Feb 2020 02:14
Forum: DOS Batch Forum
Topic: How to replace extension of a filename stored in variable?
Replies: 6
Views: 1520

Re: How to replace extension of a filename stored in variable?

Sorry I wrote the code straight into the browser without testing. The error message is clear, I forgot to double the percent sign as it is required in a batch script. Corrected above.

Steffen
by aGerman
28 Feb 2020 01:20
Forum: DOS Batch Forum
Topic: How to replace extension of a filename stored in variable?
Replies: 6
Views: 1520

Re: How to replace extension of a filename stored in variable?

Parameters and FOR variable share the modifiers you're looking for. So all you have to do is process the variable in a FOR loop

Code: Select all

set "file=C:\somewhere\foo.bar"
for %%i in ("%file%") do set "newfile=%%~dpni.png"
Steffen