Search found 1165 matches

by ShadowThief
22 Jan 2015 17:39
Forum: DOS Batch Forum
Topic: DOS equivalent of linux command pass
Replies: 9
Views: 6552

Re: DOS equivalent of linux command pass

Isn't $(ls *.txt) a value containing the output of the command ls *.txt?

You could say something like

Code: Select all

for /F %%A in (dir /b *.txt) do (
    call yourFunction %%A
)
by ShadowThief
22 Jan 2015 03:28
Forum: DOS Batch Forum
Topic: Problems printing with DOS program using "net use lpt1"
Replies: 8
Views: 8732

Re: Problems printing with DOS program using "net use lpt1"

And as for what everything else does... :: Prevent the commands from being displayed on the command prompt as they are being run @echo off :: Go to the D:\BOOKS directory. This could also have been achieved with the command cd /d D:\BOOKS D: CD \BOOKS :: Run FOXR.exe with the options BL and -T. I ha...
by ShadowThief
22 Jan 2015 03:18
Forum: DOS Batch Forum
Topic: Problems printing with DOS program using "net use lpt1"
Replies: 8
Views: 8732

Re: Problems printing with DOS program using "net use lpt1"

Try deleting the port with

Code: Select all

net use LPT1: /Delete
before running the script.
by ShadowThief
20 Jan 2015 12:16
Forum: DOS Batch Forum
Topic: Output numeric values with 2 digits after fraction?
Replies: 20
Views: 18640

Re: Output numeric values with 2 digits after fraction?

You can do that?!

Man, I really need to learn Powershell...
by ShadowThief
20 Jan 2015 10:16
Forum: DOS Batch Forum
Topic: Calling gawk from DOS batch script?
Replies: 2
Views: 3857

Re: Calling gawk from DOS batch script?

Also, in Windows, you need double quotes around your gawk command.

Try

Code: Select all

gawk "BEGIN{printf\""%%s\n\"",4/7}"
by ShadowThief
20 Jan 2015 10:12
Forum: DOS Batch Forum
Topic: Calling gawk from DOS batch script?
Replies: 2
Views: 3857

Re: Calling gawk from DOS batch script?

Either have a line in your batch like

Code: Select all

set path=%path%;"C:\path\to\gawk.exe"


or

Code: Select all

start "" /b gawk 'BEGIN{printf"%%s\n",4/7}'
by ShadowThief
20 Jan 2015 10:05
Forum: DOS Batch Forum
Topic: Output numeric values with 2 digits after fraction?
Replies: 20
Views: 18640

Re: Output numeric values with 2 digits after fraction?

Oh, european decimals. I don't have a way of testing that, but it should be similar. You may have to convert the commas to periods first.
by ShadowThief
20 Jan 2015 10:03
Forum: DOS Batch Forum
Topic: Output numeric values with 2 digits after fraction?
Replies: 20
Views: 18640

Re: Output numeric values with 2 digits after fraction?

In regular powershell, you'd be able to use "{0:N2}" -f $(7/3) and get 2.33 Unfortunately, I can't seem to get it to work in a command prompt one-liner. That said, you can take a second for loop, split it at the decimal, crop the back half to two decimal points, and recombine the string. @...
by ShadowThief
20 Jan 2015 08:25
Forum: DOS Batch Forum
Topic: Output numeric values with 2 digits after fraction?
Replies: 20
Views: 18640

Re: Output numeric values with 2 digits after fraction?

You can throw the needed math into a powershell command wrapped in a for loop, if you have PowerShell installed (you probably do).

Code: Select all

for /F %%A in ('powershell 7/3') do set aaa=%%A
by ShadowThief
05 Jan 2015 22:47
Forum: DOS Batch Forum
Topic: Read a file in reverse-last line first
Replies: 3
Views: 4436

Re: Read a file in reverse-last line first

You could run it through a for loop and set a variable every time you locate the string you're looking for so that the variable gets overwritten every time and you eventually end up with the last instance.
by ShadowThief
29 Dec 2014 16:26
Forum: DOS Batch Forum
Topic: ahci.sys
Replies: 12
Views: 22387

Re: ahci.sys

Squashman wrote:Just did a Google search for the file you were looking for. Seems to be plenty of options for getting it.

Almost every single link I found for it was the same dead hp.com link.
by ShadowThief
29 Dec 2014 15:23
Forum: DOS Batch Forum
Topic: ahci.sys
Replies: 12
Views: 22387

Re: ahci.sys

m looks promising. TITLE: SATA Compatible AHCI Driver VERSION: 1.0.0.0 Rev. A DESCRIPTION: This package contains a utility to provide the SATA compatible AHCI driver and supporting files that are necessary for Drive Letter Access (DLA) when booting from a SATA optical drive. It can be used with the ...
by ShadowThief
26 Dec 2014 17:48
Forum: DOS Batch Forum
Topic: Batch RPG Shop
Replies: 20
Views: 11171

Re: Batch RPG Shop

You're using %TotalDMG% do deal damage, but you update %WepDMG% when you buy a dagger and then you never update %TotalDMG% to match.
by ShadowThief
17 Dec 2014 18:21
Forum: DOS Batch Forum
Topic: Can a For loop work inside an IF statement?
Replies: 8
Views: 5778

Re: Can a For loop work inside an IF statement?

What's not working? Having a for loop inside of an if statement is perfectly valid. Really the only thing I see "wrong" with your code is that you've got spaces around the ==, which will cause unexpected behavior since batch will include the spaces in the comparison when it shouldn't. Also...