Search found 3974 matches

by Squashman
09 Oct 2019 21:33
Forum: DOS Batch Forum
Topic: Remove Microsoft header from cmd, for example when executing code from alternate data stream
Replies: 10
Views: 301

Re: Remove Microsoft header from cmd, for example when executing code from alternate data stream

What is your end game for using ADS? Just want to make you aware that the ADS is only local to the system you are using it on. If you try to upload or email a file with an ADS, only the main data stream is transferred.
by Squashman
27 Sep 2019 12:02
Forum: DOS Batch Forum
Topic: how to check file exists or not : batch script
Replies: 2
Views: 357

Re: how to check file exists or not : batch script

The help file gives some pretty clear information on how to do that. C:\>if /? Performs conditional processing in batch programs. IF [NOT] ERRORLEVEL number command IF [NOT] string1==string2 command IF [NOT] EXIST filename command NOT Specifies that Windows should carry out the command only if the c...
by Squashman
27 Sep 2019 10:00
Forum: DOS Batch Forum
Topic: non-buffering FOR /F alternative
Replies: 7
Views: 580

Re: non-buffering FOR /F alternative

So is reading the file similar to what you were doing here?

Essentially tailing a file?

Code: Select all

@echo off
call :Loop <"tailme.txt"

exit

:Loop
set "line="
set /p "line="
if defined line (
  echo %line%
) else (
  pathping -q 1 -p 300 localhost >nul
)
goto :loop
by Squashman
03 May 2019 08:22
Forum: DOS Batch Forum
Topic: Dir with wildcard returning unexpected result
Replies: 4
Views: 992

Re: Dir with wildcard returning unexpected result

I'm not using the short name format. I tried with the /X and i still get filenames I dont want Never said you were using short file names nor did I say using /X would solve your problem. I am saying the default behavior is that the WILDCARD will also match short file names. The EXAMPLE your provide...
by Squashman
02 May 2019 15:49
Forum: DOS Batch Forum
Topic: Dir with wildcard returning unexpected result
Replies: 4
Views: 992

Re: Dir with wildcard returning unexpected result

It is matching the short file names. 8.3.
Run the DIR command from a command prompt and use the /X option to see what I mean.
by Squashman
01 May 2019 08:46
Forum: DOS Batch Forum
Topic: Get Parent Directory as a variable
Replies: 6
Views: 1136

Re: Get Parent Directory as a variable

The help files for the CALL and FOR commands explain the modifiers you can use to get a files parent directory. CALL In addition, expansion of batch script argument references (%0, %1, etc.) have been changed as follows: %* in a batch script refers to all the arguments (e.g. %1 %2 %3 %4 %5 ...) Subs...
by Squashman
27 Apr 2019 20:56
Forum: DOS Batch Forum
Topic: gzip batch
Replies: 30
Views: 4922

Re: gzip batch

C:\>C:\BatchFiles\GZIP>gz.bat index.html Le client ne dispose pas d’un privilège nécessaire. C:\>C:\BatchFiles\GZIP>gz.bat file.css Le client ne dispose pas d’un privilège nécessaire. C:\>C:\BatchFiles\GZIP>gz.bat foobar.js Le client ne dispose pas d’un privilège nécessaire. All three of those comm...
by Squashman
27 Apr 2019 20:40
Forum: DOS Batch Forum
Topic: Color Ascii Art
Replies: 8
Views: 9302

Re: Color Ascii Art

lylalandry wrote:
27 Apr 2019 03:25
How you convert image to ascii?
Reading is fun.
by Squashman
27 Apr 2019 20:37
Forum: DOS Batch Forum
Topic: Hard link in batch
Replies: 11
Views: 2123

Re: Hard link in batch

Would have never occurred to me to think a wildcard would work with creating any type of link.
by Squashman
27 Apr 2019 16:29
Forum: DOS Batch Forum
Topic: Hard link in batch
Replies: 11
Views: 2123

Re: Hard link in batch

It would help if you told us what the error was and what line of code was producing that error.
by Squashman
22 Apr 2019 08:43
Forum: DOS Batch Forum
Topic: Some content of text file lost when printing to screen
Replies: 17
Views: 4356

Re: Some content of text file lost when printing to screen

sincos2007 wrote:
22 Apr 2019 05:24
I have seen following syntax in bash shell
doubtful.
by Squashman
21 Apr 2019 16:09
Forum: DOS Batch Forum
Topic: Some content of text file lost when printing to screen
Replies: 17
Views: 4356

Re: Some content of text file lost when printing to screen

sincos2007 wrote:
20 Apr 2019 23:54
aGerman wrote:
20 Apr 2019 12:03
Give this a go:

Code: Select all

>>"txt2.txt" findstr /vb "##" "txt1.txt"
Steffen
Hi Steffen,

With your code, how can I get count of lines starting with ##

And I want to do some operations on the line not starting with ##, what should I do?

Thanks
Scope creep!
by Squashman
20 Apr 2019 12:15
Forum: DOS Batch Forum
Topic: Some content of text file lost when printing to screen
Replies: 17
Views: 4356

Re: Some content of text file lost when printing to screen

I am trying to read each line from a text file, and if the line does not begin with ##, append this line to another text file. thanks This thread could have been 2 posts long. Remember that everyone here is volunteering their time to help other people. When you don't provide the needed information ...
by Squashman
20 Apr 2019 09:09
Forum: DOS Batch Forum
Topic: Some content of text file lost when printing to screen
Replies: 17
Views: 4356

Re: Some content of text file lost when printing to screen

You essentially need to show us a minimal, complete and verifiable example of what you are trying to do. You can't just show a code snippet and then expect us to know there is more to your batch file that is getting affected.