?

Log in

No account? Create an account

November 4th, 2003


Previous Entry Share Next Entry
02:41 pm
any DOS batch file gurus out there?
I need to write a frontend for Net Send for my boss.
basically I just need it to go like this:


Text to send: *boss types text in, hits return*
net send [all our usernames] "[inputed text]"
Message sent!
Press any key to continue...


so how do I get it to input text into a variable and then use that variable in another statement? it's driving me nuts. it's the only part I'm stuck on.
A few years ago I would have whipped this out without blinking, but i'm just getting back to doing old skool batch files again.


Thanks for any help.
mood: aggravatedaggravated

(3 bits of drivel | babble incoherently)

Comments:


[User Picture]
From:axessdenyd
Date:November 4th, 2003 01:58 pm (UTC)
(Link)
Fred forgot his DOSREXX, Fred forgot his DOSREXX...

I think the all caps kinda ruin the lyricism of it.
[User Picture]
From:d_m
Date:November 4th, 2003 08:19 pm (UTC)

COMMAND.COM IS SO FUCKING AWFUL

(Link)
// Try this, without "// " of course:

// REM == comment in DOS

// REM first we initialize the var to
// REM since all DOS programs share a namespace
// set var=
//
// REM then we set variable from input using prompt
// REM the "%=%" is not part of the prompt
// set /P var=This is the greatest prompt ever: %=%
//
// REM now we have the variable initialized, and
// REM can do what we want.
// echo This is the variable: %var%

// I had to write a DOS script recently.

// btw.. I recommend naming it *.COM instead of *.BAT--
// that way it will use the new interpreter.

// HTH -- d_m
[User Picture]
From:d_m
Date:November 4th, 2003 08:26 pm (UTC)

BILLY GATES STOP MAKING MONEY AND STEP IN FRONT OF A TRAIN

(Link)
// ALSO FOR THE RECORD:

// In WinXP, as far as I can tell, doing any sort of "set"
// in a block statment (i.e. inside an "if") doesn't
// resolve until you get back to the base level, or at least
// leave the block.

// The workaround is ugly like a gut wound.

// So, make sure to not use that in an "if" statement.
any DOS batch file gurus out there? I need to write a frontend for… - another LJ. or: how i learned to stop worrying and love this life-thingy

> Recent Entries
> Archive
> Friends
> Profile
> Lord Google

Links
sluggy
userfriendly
sinfest
schlock
reallife
Cyanide&Happiness
goats
somethingpositive
pvp
xkcd
lil gamers
fruitfucker
ctrl-alt-del
Genius!
digger
LFG
applegeeks
threepanelsoul
drive!
vgcats
Erfworld
Freakangels
DresdenCodak
Angst!
.
EatYourBeer
rain?
POSTULATE!

> Go to Top
LiveJournal.com