Search found 15 matches

by avizee
09 Feb 2021 08:08
Forum: DOS Batch Forum
Topic: Set a multiline variable
Replies: 13
Views: 10208

Re: Set a multiline variable (echo now working)

I want to be displayed on the screen ' [+] SRV-001 ' To be put into a text file ' ===========================================================================-= ' That output is simpler still, and does not require a multiline variable. It's just Concatenated commands that sends one string of output ...
by avizee
06 Feb 2021 23:54
Forum: DOS Batch Forum
Topic: Set a multiline variable
Replies: 13
Views: 10208

Re: Set a multiline variable

echo.[+] %check_code% -> Not working!!! As shadowthief has already asked, What output do you actually expect? If you require this output: [+] Part_001 ============================================================================= You can use a macro like this: @Echo off (Set LF=^ %= Linefeed variabl...
by avizee
06 Feb 2021 23:53
Forum: DOS Batch Forum
Topic: Set a multiline variable
Replies: 13
Views: 10208

Re: Set a multiline variable

Squashman wrote:
06 Feb 2021 23:36
Both threads have been merged
Thanks! :)
by avizee
06 Feb 2021 20:05
Forum: DOS Batch Forum
Topic: Set a multiline variable
Replies: 13
Views: 10208

Re: Set a multiline variable (echo now working)

You could have stayed in the original thread. You have to set variables BEFORE you use them, so move the set check_code line above the set header line. Also, that first >> [F_RESULT]__%COMPUTERNAME%.xml 2>nul being inside of the set header line means that your last line is saying echo >nul & echo.[...
by avizee
06 Feb 2021 09:16
Forum: DOS Batch Forum
Topic: Set a multiline variable
Replies: 13
Views: 10208

Re: Set a multiline variable

echo.[+] %check_code% -> Not working!!! As shadowthief has already asked, What output do you actually expect? If you require this output: [+] Part_001 ============================================================================= You can use a macro like this: @Echo off (Set LF=^ %= Linefeed variabl...
by avizee
06 Feb 2021 08:59
Forum: DOS Batch Forum
Topic: Set a multiline variable
Replies: 13
Views: 10208

Set a multiline variable (echo now working)

I did not write the previous question specifically, so I rewrite it. This is my batch code @echo off SETLOCAL set "header=> nul& echo.[+] %check_code% & echo.===========================================================================-= >> [F_RESULT]__%COMPUTERNAME%.xml 2> nul" set "check_code=SRV-00...
by avizee
05 Feb 2021 23:59
Forum: DOS Batch Forum
Topic: Set a multiline variable
Replies: 13
Views: 10208

Re: Set a multiline variable

echo.[+] %check_code% -> Not working!!!
by avizee
05 Feb 2021 18:26
Forum: DOS Batch Forum
Topic: Set a multiline variable
Replies: 13
Views: 10208

Set a multiline variable

. Thanks for the comment I wrote again https://www.dostips.com/forum/viewtopic.php?f=3&t=9951 =================================================================================== I'm trying to echo a variable made of multiple lines But "echo.[+] %check_code%" doesn't work How can it be possible Thank...
by avizee
16 Jan 2020 14:47
Forum: DOS Batch Forum
Topic: Redirect text to a file (runas command result)
Replies: 13
Views: 13745

Re: Redirect text to a file (runas command result)

This is what I making net user | findstr /v /i "change profile Memberships User's \\ successfully -------------------------------------------------------------------------------" > [#####]_useracc_temp1.txt 2> nul type [#####]_useracc_temp1.txt | findstr . > [#####]_useracc_temp2.txt 2> nul for /f "...
by avizee
15 Jan 2020 17:47
Forum: DOS Batch Forum
Topic: Redirect text to a file (runas command result)
Replies: 13
Views: 13745

Re: Redirect text to a file (runas command result)

I tested Windows 10, Windows Server 2012 R2, Windows Server 2016.

There are no error message.

Test results are this. :)

-------------------------------------------

Enter the password for nopasscheck:

Enter the password for asdf:
by avizee
15 Jan 2020 15:04
Forum: DOS Batch Forum
Topic: Redirect text to a file (runas command result)
Replies: 13
Views: 13745

Re: Redirect text to a file (runas command result)

Thanks for the help :)

But this doesn't work either
by avizee
14 Jan 2020 17:56
Forum: DOS Batch Forum
Topic: Redirect text to a file (runas command result)
Replies: 13
Views: 13745

Re: Redirect text to a file (runas command result)

Hi! Eureka!

1. I know '|' do not support entering password 'runas.exe' command :)
2. I only need 'runas.exe' error message ( 1326: The user name or password is incorrect. )
and does not work 'cmd /c' command
by avizee
14 Jan 2020 08:37
Forum: DOS Batch Forum
Topic: Redirect text to a file (runas command result)
Replies: 13
Views: 13745

Re: Redirect text to a file (runas command result)

echo .|((runas /user:nopasstest "echo %date%" 2>&1) > "test.txt") ((echo .|runas /user:nopasstest "echo %date%" 2>&1) > "test.txt") (echo .|(runas /user:nopasstest "echo %date%" 2>&1) > "test.txt") echo .((|runas /user:nopasstest "echo %date%") > "test.txt" 2>&1) ((echo .|runas /user:nopasstest "ech...
by avizee
14 Jan 2020 08:29
Forum: DOS Batch Forum
Topic: Redirect text to a file (runas command result)
Replies: 13
Views: 13745

Re: Redirect text to a file (runas command result)

Appreciate the quick response.

But it doesn't work. :)

echo .|((runas /user:nopasstest "echo %date%" 2>&1) > test.txt)
by avizee
14 Jan 2020 01:58
Forum: DOS Batch Forum
Topic: Redirect text to a file (runas command result)
Replies: 13
Views: 13745

Redirect text to a file (runas command result)

Thank you for reading first. ------------------------------------------------------------------ I need runas result text. But this redirect command does not work. "echo .|runas /user:administrator echo %date% > test.txt" ------------------------------------------------------------------ This is the ...