Search found 122 matches

by elzooilogico
28 Sep 2020 03:34
Forum: DOS Batch Forum
Topic: How to remove Quotes from a variable with "ampersand" (&) ?
Replies: 1
Views: 24

Re: How to remove Quotes from a variable with "ampersand" (&) ?

you can use a for loop to remove quotes with the ~ modifier. see for /? for further information.

Code: Select all

for %%a in (%dir%) do echo %%~a
by elzooilogico
17 Sep 2020 03:41
Forum: DOS Batch Forum
Topic: How to pass "chcp 1252" command to START "" /B /WAIT program?
Replies: 4
Views: 124

Re: How to pass "chcp 1252" command to START "" /B /WAIT program?

have you tried

Code: Select all

start "" /NORMAL /B /WAIT ">nul chcp 1252 & D:\foobar\myprog.exe /parm1 /parm2 someparm”
by elzooilogico
28 Aug 2020 08:26
Forum: DOS Batch Forum
Topic: SerialPort copy string instead of file
Replies: 5
Views: 433

Re: SerialPort copy string instead of file

have you tried

Code: Select all

echo hello>COM3
or

Code: Select all

set /p str=“hello" <nul >\\.\COM3
the diference here is that first writes hello plus CR+LF, and the second one does not.
by elzooilogico
05 May 2020 14:37
Forum: DOS Batch Forum
Topic: Depicus wake on lan batch file question
Replies: 3
Views: 1561

Re: Depicus wake on lan batch file question

that's what pause command does, wait for user to press a key. simply change

Code: Select all

pause
to

Code: Select all

timeout /t 2
to wait two seconds
by elzooilogico
20 Apr 2020 09:11
Forum: DOS Batch Forum
Topic: How to disable Avast until reboot
Replies: 7
Views: 2158

Re: How to disable Avast until reboot

aren't those procceses (or at least one of them) services?

in that case you need

Code: Select all

sc stop ""ServiceName"
or

Code: Select all

net stop "ServiceName"
by elzooilogico
06 Apr 2020 09:12
Forum: DOS Batch Forum
Topic: Windows Batch - Print line file containing exclamation mark
Replies: 6
Views: 2091

Re: Windows Batch - Print line file containing exclamation mark

disable delayed expansion, unless you are doing something with sLine you don't need it, change set "sLine=%%A" echo !sLine! to echo %%A or use call set "..." call echo %...% ro reflect changes in a block of code you cannot do string proccessing with for variables, but you can turn off delayed expans...
by elzooilogico
02 Mar 2020 13:01
Forum: DOS Batch Forum
Topic: [SOLVED] Extract each whole line that contains a specific word.
Replies: 8
Views: 4215

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

Code: Select all

for /f "delims=" %%i in ('findstr "\<true\>" "MyFile.wccf"') do echo %%i
if you are running it in a batch script

Code: Select all

for /f "delims=" %i in ('findstr "\<true\>" "MyFile.wccf"') do echo %i
if you run it in command line
by elzooilogico
31 Oct 2019 11:01
Forum: DOS Batch Forum
Topic: Batch script to login to multiple windows server
Replies: 8
Views: 5336

Re: Batch script to login to multiple windows server

with cmdkey yoy can store credentials to access computers over the net. read the cmdkey command help. long ago I used a batch script which executes cmdkey and wmic to run proccesses and fetch its output over many servers. no need to logon, nor any user session on remote server, provided not gui app ...
by elzooilogico
15 Oct 2019 08:31
Forum: DOS Batch Forum
Topic: How can you compare two files Binary and notify?
Replies: 3
Views: 7907

Re: How can you compare two files Binary and notify?

Code: Select all

fc /b path\file1.bin path\file2.bin
if %errorlevel% neq 0 (
  echo(files are different
) else (
  echo(files are identical
 )
see

Code: Select all

fc /?
for further information, and

Code: Select all

for /f
about to capture output of a command
by elzooilogico
23 Aug 2019 13:58
Forum: DOS Batch Forum
Topic: mutiple validation in same do not working
Replies: 2
Views: 2765

Re: mutiple validation in same do not working

review your code, you have unbalanced parentheses. try to change

Code: Select all

echo(…
to

Code: Select all

echo/…
to see what's happening. then tou may return to

Code: Select all

echo(…
as it has especial meaning, it's not an opening parens ar all!
by elzooilogico
08 Jul 2019 11:56
Forum: DOS Batch Forum
Topic: Months SCHTASKS
Replies: 2
Views: 3193

Re: Months SCHTASKS

please, write in english, though many of us have other native language, we use english in this site!
by elzooilogico
04 Jun 2019 00:06
Forum: DOS Batch Forum
Topic: Text Files - Coloured Characters
Replies: 6
Views: 3750

Re: Text Files - Coloured Characters

or you may try ansicon