
September 10th, 2007, 08:21 PM
|
 |
Java Junkie
|
|
Join Date: Jan 2004
Location: Mobile, Alabama
|
|
Quote: | Originally Posted by 0x90 Hello,
how can I set a command as a variable in windows batch script?
this is the script //its just a test:
Code:
@ECHO off
SET /P userpass=Enter Password:
::hash = 123
SET userhash=202CB962AC59075B964B07152D234B70
SET userpass1=%cd%md5.exe -d%userpass%
IF "%userhash%" == "%userpass1%" (
ECHO good
) ELSE (
ECHO bad
)
goto :EOF
in linux it accept commands with variables:
Code:
#!/bin/sh
echo -n "Enter Password: "
read userpass
#hash = 123
userhash="ba1f2511fc30423bdbb183fe33f3dd0f"
userpass1=`echo "$userpass" | md5sum | awk '{print $1}'`
if [ "$userhash" == "$userpass1" ]; then
echo "good"
else
echo "bad"
fi
any idea
thanks, |
Have you considered installing Perl on your machine?
|