Search found 3995 matches

by Squashman
27 Apr 2019 20:37
Forum: DOS Batch Forum
Topic: Hard link in batch
Replies: 11
Views: 3588

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: 3588

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: 8534

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: 8534

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: 8534

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: 8534

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.
by Squashman
20 Apr 2019 09:07
Forum: DOS Batch Forum
Topic: gzip batch
Replies: 30
Views: 8074

Re: gzip batch

What is the point of showing the directory contents three times? That is not what I did in my example to show you that the batch file does in fact work correct. I did a directory listing. Then executed the batch file three times. One for each file. Then I did a directory listing again.
by Squashman
19 Apr 2019 15:20
Forum: DOS Batch Forum
Topic: Some content of text file lost when printing to screen
Replies: 17
Views: 8534

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

Remove the line that enables delayed expansion.
by Squashman
19 Apr 2019 15:12
Forum: DOS Batch Forum
Topic: gzip batch
Replies: 30
Views: 8074

Re: gzip batch

In both of your previous two examples I do not see you executing the batch file like I did in my example to show you that it works.
by Squashman
19 Apr 2019 08:35
Forum: DOS Batch Forum
Topic: gzip batch
Replies: 30
Views: 8074

Re: gzip batch

Would like to remind you that this is an English speaking forum and if you want help you need to translate everything to English.
by Squashman
18 Apr 2019 10:22
Forum: DOS Batch Forum
Topic: gzip batch
Replies: 30
Views: 8074

Re: gzip batch

No problems using the script on my end. Directory listing C:\BatchFiles\GZIP>dir Volume in drive C is 15_10P Volume Serial Number is DE79-4A59 Directory of C:\BatchFiles\GZIP 04/18/2019 11:20 AM <DIR> . 04/18/2019 11:20 AM <DIR> .. 04/18/2019 11:18 AM 34 file.css 04/18/2019 11:19 AM 53 foobar.js 04/...
by Squashman
18 Apr 2019 08:27
Forum: DOS Batch Forum
Topic: Is there any way to know a folder is open or not using command line?
Replies: 2
Views: 888

Re: Is there any way to know a folder is open or not using command line?

Learned this from dbenham.

Code: Select all

2>nul ren Downloads Downloads && echo Folder is NOT locked || echo folder is LOCKED
by Squashman
09 Apr 2019 08:41
Forum: DOS Batch Forum
Topic: set %RANDOM% for timeout command
Replies: 7
Views: 2003

Re: set %RANDOM% for timeout command

A more concise way to get a number between 1 and 100.

Code: Select all

SET /A test=%RANDOM% %% 100 + 1
by Squashman
09 Apr 2019 08:34
Forum: DOS Batch Forum
Topic: How to sort file contents based on pattern?
Replies: 4
Views: 1177

Re: How to sort file contents based on pattern?

Ah yes, very simple using the tokens. Yes as you have been shown and used several times on this forum. FOR /F "tokens=2 delims=_." %%A IN ('FINDSTR /c:"%OUTBOX_BIN%%NAME%_" %FILE%') DO ( SET "NUM=%%~A" IF !NUM! GTR !MAXNUM! SET "MAXNUM=!NUM!" & SET "MAXFILE=%NAME%_!MAXNUM!.log" ) No need to set the...