MCT Posted March 17, 2005 Posted March 17, 2005 im wanting 2 have a popup which asks a question & only use 1 cmd file examplehave an autoit script popup & ask if i want to enable or Disable something & have it "goto Yes" or "Goto No" like u would in a batch file with the prompt commandsee what i mean? lol i get confused even trying 2 explain it
un4given1 Posted March 17, 2005 Posted March 17, 2005 @echo off:STARTCLSSET /P var1=Would you like to enable something?SET var1=%var1:~0,1%IF /I %var1%==y (goto YES)IF /I %var1%==n (goto NO)GOTO START:YESecho YESGOTO END:NOecho NOGOTO ENDThat should do it...
MCT Posted March 17, 2005 Author Posted March 17, 2005 yes, i know how 2 do it with a prompt via cmd file..but what im wanting 2 do, is have the message window instead of entering y/n in a cmd file but im looking 4 a way 2 have the message window (autoit) pass the "goto yes/no" to the batch file
Martin Zugec Posted March 17, 2005 Posted March 17, 2005 Dont know if it will help U, but have U tryed Wizard´s Apprentice from SourceForge?
Martin Zugec Posted March 17, 2005 Posted March 17, 2005 Great (and simple) way to interact with users from batch file... Have a look:http://wizapp.sourceforge.net/
MCT Posted March 17, 2005 Author Posted March 17, 2005 ya, thanks . after i posted i searched seems to work well, except its OK/Cancel instead of Yes/No but ohwell
gunsmokingman Posted March 17, 2005 Posted March 17, 2005 (edited) This Is A Cmd That Outputs A YesNo Vbs Than Will Return What The User Selected.Blue The Vbs Out FileGreen Is Where The Yes replyRed Is The No ReplyPurple The Varible That Get Passed Between The Scriptsecho off && cls && mode 55,3 && color f3 && Title Gunsmokingman Cmd To Vbs Back To Cmdset P1=Ping -n 1 127.0.0.1set P3=Ping -n 3 127.0.0.1set VBS01=%systemdrive%\YN.vbsset Cmd1=%systemdrive%\Temp.cmd> %VBS01% Echo Set Action = CreateObject("Wscript.Shell")>> %VBS01% Echo SD = Action.ExpandEnvironmentStrings("%SystemDrive%")>> %VBS01% Echo YesNo = Msgbox(SPACE(7) ^& "Some Text message" ^& vbcrlf ^& "Another Text Message" ^& vbcrlf ^&_>> %VBS01% Echo "Yes For Some Action" ^& vbcrlf ^& "No For Some Other Action" , 4 + 48,"Gsm YesNo-2cmd")>> %VBS01% Echo If strUserIn = vbYes then>> %VBS01% Echo Set FS = CreateObject("Scripting.FileSystemObject") >> %VBS01% Echo strFileName = FS.BuildPath(Wscript.ScriptFullName ^& "\..", "\Gsm YesNo-2cmd")>> %VBS01% Echo strFileName = FS.GetAbsolutePathName(strFileName) >> %VBS01% Echo Set TS = FS.OpenTextFile(SD ^& "\Temp.cmd", 2, True) >> %VBS01% Echo TS.WriteLine "set Loc=" ^& YesNo >> %VBS01% Echo TS.Close>> %VBS01% Echo Else>> %VBS01% Echo Set FS = CreateObject("Scripting.FileSystemObject") >> %VBS01% Echo strFileName = FS.BuildPath(Wscript.ScriptFullName ^& "\..", SD ^& "\Temp.cmd")>> %VBS01% Echo strFileName = FS.GetAbsolutePathName(strFileName) >> %VBS01% Echo Set TS = FS.OpenTextFile(SD ^& "\Temp.cmd", 2, True) >> %VBS01% Echo TS.WriteLine "set Loc=" ^& YesNo>> %VBS01% Echo TS.Close>> %VBS01% Echo End If%P1%>nulSTART /w %VBS01%del %VBS01% %P1%>nulcall %Cmd1%%P1%>nuldel %Cmd1% && goto %Loc%:7cls && Color fc && Title This Is Sevenset Loc=You Said NoEcho. && Echo %Loc% && %P3%>nulgoto Quit:6cls && Color f2 && Title This Is Sixset Loc=You Said YesEcho. && Echo %Loc% && %P3%>nulgoto Quit:quitcls && Color 5eecho. && Echo Good Bye && %P3%>nulgoto EOFexit Edited December 28, 2005 by gunsmokingman
bryanh Posted March 17, 2005 Posted March 17, 2005 but im looking 4 a way 2 have the message window (autoit) pass the "goto yes/no" to the batch file<{POST_SNAPBACK}>Take a looks at "call" in Windows XP Help. You will see that you can use "call" from a batch file to start a different batch file. You can also include a label in the "Call" statement. IF supplied with a label then the batch file will start AT the label passed.That sounds like exactly what you are looking for.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now