Search found 7 matches

by b0gus
22 Mar 2018 05:03
Forum: DOS Batch Forum
Topic: How to separate long string with multiple quotations into multiple lines for each substring inside each quotation..
Replies: 8
Views: 7008

Re: How to separate long string with multiple quotations into multiple lines for each substring inside each quotation..

@dbenham, it seems to me that here the ONE closing parenthesis is superfluous:

Code: Select all

>echo_data_1.txt (for /f "usebackq delims=" %%A in ("fdata1.txt") do for %%B in (%%A) do echo %%B))
by b0gus
15 Feb 2017 06:49
Forum: DOS Batch Forum
Topic: Conditional Concatenation Of Records In A File
Replies: 2
Views: 3354

Re: Conditional Concatenation Of Records In A File

Can any one suggest me some logic on how to achieve the below. try this: @echo off & cls & SetLocal EnableExtensions EnableDelayedExpansion :enter_dir set /p "dir_source=[c:\dir1\dir2...] enter dir with source file's=" if NOT defined dir_source goto enter_dir if "%dir_source:...
by b0gus
13 Mar 2016 06:21
Forum: DOS Batch Forum
Topic: Reading a specific line from a text document
Replies: 8
Views: 23768

Re: Reading a specific line from a text document

In my program i want to take a specific line (eg. line 2: 7) and set it as a variable. may be so? @echo off set /a NTargetLine=2, N=NTargetLine-1 <test.txt (for /f %%v in ('more +%N%') do set "line=%%v" & goto done) :done echo.line number %NTargetLine% in test.txt is:%line% pause exit
by b0gus
11 Mar 2016 06:06
Forum: DOS Batch Forum
Topic: Localgroup Administrators
Replies: 5
Views: 5541

Re: Localgroup Administrators

I have script that will collect members of local server administrator group. But however i need some help on the output method. can someone assist me please ..... I do approximately so: @echo off setlocal echo:...wait for %%v in (wmic.exe) do if "%%~$path:v"=="" (echo:OS missing...
by b0gus
10 Mar 2016 02:42
Forum: DOS Batch Forum
Topic: mystery error in XP - but none in Win7
Replies: 4
Views: 5348

Re: mystery error in XP - but none in Win7

mirrormirror, on XP try this code:

Code: Select all

FOR /F "usebackq tokens=*" %A IN ('   ?/cmd: "shUser=user1"; "shPrivs=none"') DO SET tmpLn=%A
by b0gus
09 Mar 2016 06:36
Forum: DOS Batch Forum
Topic: readlink emulation: first approach
Replies: 7
Views: 7789

Re: readlink emulation: first approach

siberia-man wrote:jeb, this is bad news.

may be - no?
to jeb, try this:

Code: Select all

>nul chcp 437
dir /al
>nul chcp <your codepage>
by b0gus
09 Mar 2016 05:38
Forum: DOS Batch Forum
Topic: Detecting loopback device via batch
Replies: 6
Views: 7058

Re: Detecting loopback device via batch

noprogrammer, 7-th line write as:

Code: Select all

call Set "h=%%~?\hosts"