Hi I'm new here and I'm hoping to learn a lot from this forum. I just started learning simple batch file programming last night and found out its actually a lot of fun. If someone could please tell me why this isn't working that would be great. I'm just trying to put in a password and have it open the mplayer.exe
Thank,
Devin
@Echo off
set /p pas=Please type your password:
IF '%pas%' == 'toe' GOTO mplayerc.exe
:mplayer
"C:\Program Files (x86)\K-Lite Codec Pack\Media Player Classic\mplayerc.exe"
Help a noob with a simple .bat file. =)
Started by s4nt0s123, Oct 15 2008 01:20 PM
7 replies to this topic
#1
Posted 15 October 2008 - 01:20 PM
|
|
|
#2
Posted 15 October 2008 - 09:44 PM
18 views and nobody knows? This should be a cakewalk for you guys. =)
#3
Posted 15 October 2008 - 10:59 PM
Wow I just figured out if i type in the wrong password then it opens up the program but if I type in the right password nothing happens..I'm lost
#4
Posted 15 October 2008 - 11:05 PM
Never mind i figured it out!
Original string:
IF '%pas%' == 'toe' GOTO mplayerc.exe
Working string:
IF '%pas%' ==toe GOTO mplayerc.exe
haha I feel stupid
Original string:
IF '%pas%' == 'toe' GOTO mplayerc.exe
Working string:
IF '%pas%' ==toe GOTO mplayerc.exe
haha I feel stupid
#5
Posted 16 October 2008 - 03:36 AM
@Echo off
set /p pas=Please type your password:
IF '%pas%' == 'toe' GOTO mplayer
:mplayer
"C:\Program Files (x86)\K-Lite Codec Pack\Media Player Classic\mplayerc.exe"
when you pointed to goto you pointet to mplayerc.exe but your variable is mplayer :D
set /p pas=Please type your password:
IF '%pas%' == 'toe' GOTO mplayer
:mplayer
"C:\Program Files (x86)\K-Lite Codec Pack\Media Player Classic\mplayerc.exe"
when you pointed to goto you pointet to mplayerc.exe but your variable is mplayer :D
#6
Posted 16 October 2008 - 07:55 AM
Also, you need another goto after your IF statement so you won't launch mplayer anyway.
#7
Posted 16 October 2008 - 09:17 AM
Thanks a lot for the feedback, I was wondering how i would do the next IF statement to make it so it wont open mplayer. How could I make it to where anything but the right password will close out the program or repeat Please type your password?
So I have this
set /p pas=Please type your password:
IF '%pas%' == 'toe' GOTO mplayer
So what do I use to make sure only the right password will work?
IF '%pas%' == '?' GOTO whatever I want =)
So I have this
set /p pas=Please type your password:
IF '%pas%' == 'toe' GOTO mplayer
So what do I use to make sure only the right password will work?
IF '%pas%' == '?' GOTO whatever I want =)
#8
Posted 16 October 2008 - 10:00 AM
@Echo off
set /p pas=Please type your password:
IF '%pas%' == 'toe' GOTO mplayer
GOTO end
:mplayer
"C:\Program Files (x86)\K-Lite Codec Pack\Media Player Classic\mplayerc.exe"
:end
set /p pas=Please type your password:
IF '%pas%' == 'toe' GOTO mplayer
GOTO end
:mplayer
"C:\Program Files (x86)\K-Lite Codec Pack\Media Player Classic\mplayerc.exe"
:end


Sign In
Create Account

Back to top









