Search found 397 matches

by miskox
05 Jul 2012 00:10
Forum: DOS Batch Forum
Topic: Extract numbers only from a string - optimization
Replies: 1
Views: 3343

Extract numbers only from a string - optimization

Hi all, I have this simple code (it works, but it is slow): @echo off set mystring=x56x723@c8 echo !%mystring%! call :NUMBERS_ONLY "%mystring%" mystring echo !%mystring%! set mystring=x2c3c4c5v6 echo !%mystring%! call :NUMBERS_ONLY "%mystring%" mystring echo !%mystring%! goto :EO...
by miskox
04 Jul 2012 23:36
Forum: DOS Batch Forum
Topic: Trying to build a Uptime.exe alternative via native windows
Replies: 31
Views: 24395

Re: Trying to build a Uptime.exe alternative via native wind

Systeminfo has this info. Though I think this command is not available in XP Home. Don't know about other versions. Also, I have a batch file (which I can upload later) which calculates the uptime using this (if I remember correctly) command: net statistics workstation But it is possible to reset t...
by miskox
19 Jun 2012 16:29
Forum: DOS Batch Forum
Topic: check registry values and firewall rules [solved]
Replies: 5
Views: 4319

Re: check registry values and firewall rules [solved]

@yaiohena: This is offtopic, but utorrent was mentioned above so: I would do this: 1. Maybe you could make a backup of these partialy downloaded files? 2. open this .torrent file with uTorrent - make sure download location is the same. Also make sure it does *not* start. 3. right click on the torren...
by miskox
29 May 2012 14:03
Forum: DOS Batch Forum
Topic: Batch Files! What is the most absurd you've seen?
Replies: 7
Views: 4004

Re: Batch Files! What is the most absurd you've seen?

Code: Select all

@echo off
:00
goto :00


Just to use as much CPU as possible so my Tetris game would run slower.

Saso
by miskox
29 May 2012 14:02
Forum: DOS Batch Forum
Topic: DOS to word processor to USB drive
Replies: 12
Views: 5785

Re: DOS to word processor to USB drive

Maybe just an idea: TinyXP. You can have a working XP in just 50 M bytes. Boots fast, installs fast. It has limited funcionality but this is what you want.

Saso
by miskox
14 May 2012 01:52
Forum: DOS Batch Forum
Topic: Newbi Help with Batch file
Replies: 10
Views: 4982

Re: Newbi Help with Batch file

Maybe this could be useful to you:

BGinfo

http://technet.microsoft.com/en-us/sysi ... s/bb897557

Saso
by miskox
13 May 2012 09:51
Forum: DOS Batch Forum
Topic: FOR /F loop text files: why blank lines are skipped?
Replies: 5
Views: 3452

Re: FOR /F loop text files: why blank lines are skipped?

Code: Select all

help for


says:

Code: Select all

Blank lines are skipped.


Saso
by miskox
13 May 2012 03:17
Forum: DOS Batch Forum
Topic: How to sort numbers in a text file?
Replies: 19
Views: 10970

Re: How to sort numbers in a text file?

My solution: Input file (filez.txt): "a:\AmericanDad-S07E15-LessMoneyMoProblems-14669961-0.mpg" 2986316918 "a:\AmericanDad-S07E16-TheKidneyStaysinthePicture-14751494-0.mpg" 2954978570 "a:\Californication-S05E12-HellAintaBadPlacetoBe-14751936-0.mpg" 4342208176 "a:\D...
by miskox
09 May 2012 15:20
Forum: DOS Batch Forum
Topic: How To Detect User Interacting With Console vs. Auto Task
Replies: 16
Views: 7505

Re: How To Detect User Interacting With Console vs. Auto Tas

One way would be like this: - under the scheduled task you add a unique parameter and when job executes batch file will know that it was run as a scheduled task: Under Scheduled tasks: Run: yourbatch.cmd "SCHEDULED_TASK" Another idea: - under which account a scheduled task runs? Probably D...
by miskox
06 May 2012 03:29
Forum: DOS Batch Forum
Topic: Echo command and environment variable
Replies: 8
Views: 4651

Re: Echo command and environment variable

Code: Select all

@echo %%windir%%>outputfile.txt


Hope this helps,
Saso
by miskox
01 May 2012 17:43
Forum: DOS Batch Forum
Topic: Getting free space of a mapped network drive in GBs
Replies: 17
Views: 10135

Re: Getting free space of a mapped network drive in GBs

Aacini, very good. I have one improvement: this code :: set freeSpace=%freeSpace:.=% should be added just below the :: set freeSpace=%freeSpace:,=% So the code would delete , and . from the string. We use dots as a thousand separators and not commas. Also decimal point is replaced by comma. (COBOL h...
by miskox
28 Apr 2012 11:01
Forum: DOS Batch Forum
Topic: Search for files that contain both words...
Replies: 12
Views: 5157

Re: Search for files that contain both words...

This works for me:

Code: Select all

@echo off
for /f "tokens=1* delims=" %%A in ('dir/on/b *.*') do (
   find /I "DOS" %%A>nul 2>nul&&find /I "batch" %%A>nul 2>nul&&echo %%A
)
goto :EOF


Of course it will find your batch procedure.

Saso
by miskox
18 Apr 2012 00:42
Forum: DOS Batch Forum
Topic: Exit FOR loop prematurely?
Replies: 7
Views: 7036

Re: Exit FOR loop prematurely?

Yes, of course.

Thanks,
Saso
by miskox
18 Apr 2012 00:40
Forum: DOS Batch Forum
Topic: How to find the newest file containing a txt string
Replies: 19
Views: 6569

Re: How to find the newest file containing a txt string

Yes. 12:00 AM should be written as 00:00.

Saso
by miskox
17 Apr 2012 09:54
Forum: DOS Batch Forum
Topic: Exit FOR loop prematurely?
Replies: 7
Views: 7036

Re: Exit FOR loop prematurely?

Thank you. I modified your solution to meet my needs. Now it works. I set a flag in a subroutine and I then check for this flag in a FOR loop (within () ) - though I would prefer a solution without this. Still remains: why my original script does not work? Thank you again. Now I managed to save even...