Search found 237 matches

by DosItHelp
23 Mar 2011 21:21
Forum: DOS Batch Forum
Topic: Please check this code for any further optimization
Replies: 2
Views: 4176

Re: Please check this code for any further optimization

BVKmohan, how about simply: if "%1%2" EQU "" (call:null_input) else (call:done_send_to_engine %1 %2) if both %1 and %2 are empty then the concatenation "%1%2" will be empty and the condition be TRUE. Otherwise: if %1 is empty then %1 resolves to an empty string and you ...
by DosItHelp
20 Dec 2010 23:05
Forum: DOS Batch Forum
Topic: netsh dns and IP settings!
Replies: 1
Views: 4133

Re: netsh dns and IP settings!

merrimanmerlin, I tried same in the past and could not get this working without using the "-f ScriptFile" option. I didn't like the idea ending up with two files, a netsh script file and a batch file that runs the script, so I played around and found a way to embed the netsh ScriptFile int...
by DosItHelp
20 Dec 2010 22:12
Forum: DOS Batch Forum
Topic: mv selected file to new location
Replies: 2
Views: 4315

Re: mv selected file to new location

Try "move" instead of "mv" :wink:

move %1 M:\
by DosItHelp
07 Dec 2010 19:44
Forum: DOS Batch Forum
Topic: Broken Link on dostips home page
Replies: 4
Views: 6144

Re: Broken Link on dostips home page

Finally fixed. Sorry for late response. But many thanks for for pointing this out. :)
by DosItHelp
22 Nov 2010 00:32
Forum: DOS Batch Forum
Topic: strLen boosted
Replies: 24
Views: 34965

Re: strLen boosted

Sure... In short: The value for the len variable is build successively by setting its binary bits using a loop and trial-and-error. The loop loops 13 times. Each time looping a different bit is being decided on. The first loop decides about bit 12 (4096) of the len value the next about bit 11 (2048)...
by DosItHelp
17 Nov 2010 17:37
Forum: DOS Batch Forum
Topic: strLen boosted
Replies: 24
Views: 34965

Re: strLen boosted

oh - I should have looked a bit closer, no real need for my post this again (removed).
by DosItHelp
16 Nov 2010 22:07
Forum: DOS Batch Forum
Topic: strLen boosted
Replies: 24
Views: 34965

Re: strLen boosted

Jeb, Amel, very very nice! sowgtsoi, Yes the :strlen function at m turned out the way it is because: goto:label - is darn slow "goto" appears to search for "label" by looking downwards in the batch starting from the current command until it hits the end of the batch, and then it ...
by DosItHelp
16 Nov 2010 19:04
Forum: DOS Batch Forum
Topic: Reading variables from a text file Using For /F command
Replies: 15
Views: 15619

Re: Reading variables from a text file Using For /F command

Interesting. The problem can be fixed by "piping" the text file into the findstr command, instead of using "input redirection". @echo off setlocal set LANG=EN-UK for /f "tokens=* delims=" %%a in ('type "setsfile"^|findstr /i /b /c:"SET %LANG%"') do (...
by DosItHelp
16 Nov 2010 01:14
Forum: DOS Batch Forum
Topic: Reading variables from a text file Using For /F command
Replies: 15
Views: 15619

Re: Reading variables from a text file Using For /F command

I tried with the text you send and it looks fine on my box for EN-UK, as far I can tell. What error do you get, for which language? The findstr should ignore all comments so I can't see how the comments could cause a problem, but may be I'm missing something. When filtering only the lines starting w...
by DosItHelp
14 Nov 2010 13:06
Forum: DOS Batch Forum
Topic: How to remove string from another string in batch
Replies: 13
Views: 13229

Re: How to remove string from another string in batch

Nice job amel27. A little more is needed when the command has quotes in it, which it doesn't in vivek4075 case. @echo off call :RmPass mywork password=xxx server username=abc doaction call :RmPass mywork server username=abc doaction password=xxx call :RmPass mywork server username=abc doaction call ...
by DosItHelp
14 Nov 2010 12:27
Forum: DOS Batch Forum
Topic: Reading variables from a text file Using For /F command
Replies: 15
Views: 15619

Re: Reading variables from a text file Using For /F command

May be something in the text file is screwing up the parsing.

I tested this with the text you send in your first post and it worked.
Can you try same?

Optionally you can post the full NewFilename_M11.txt into the forum, so I can take a look.
by DosItHelp
13 Nov 2010 13:15
Forum: DOS Batch Forum
Topic: How to remove string from another string in batch
Replies: 13
Views: 13229

Re: How to remove string from another string in batch

@echo off set command=mywork server username=abc password=xxxx doaction echo %command% echo. rem strip password from command set command="%command: =" "%" set "newcommand=" for %%A in (%command%) do ( echo.%%~A|findstr /i /b /c:"password=">NUL||call set "...
by DosItHelp
13 Nov 2010 12:12
Forum: DOS Batch Forum
Topic: Reading variables from a text file Using For /F command
Replies: 15
Views: 15619

Re: Reading variables from a text file Using For /F command

@echo off set LANG=EN-UK rem applying language settings for /f "tokens=* delims=" %%a in ('findstr /i /b /c:"SET %LANG%" ^< setsfile') do ( for /f "tokens=3,* delims== " %%x in ("%%a") do ( echo.%%x - %%y set %%x=%%y ) ) rem accessing the resolved variables e...
by DosItHelp
01 Jun 2010 19:27
Forum: DOS Batch Forum
Topic: Echoing '|' Doesnt work
Replies: 5
Views: 6741

Re: Echoing '|' Doesnt work

Code: Select all

@echo off
for %%A in (
  "+--TITLE--+"
  "|Data     |"
  "|Data     |"
  "+---------+"
) do echo.%%~A

DosItHelp?
by DosItHelp
10 May 2010 19:52
Forum: DOS Batch Forum
Topic: Experiment with call and label
Replies: 1
Views: 5284

Re: Experiment with call and label

Insane :)