Kelsenellenelvian Posted July 29, 2010 Share Posted July 29, 2010 OK I forgot ALOT of dos commands!I need a Basic cmd file that gives 3 choices 1 = Run app2 = Run app w\switch /B3 = Exit.Can one of you gurus give me a hand?Yes I wish for a cmd file as size DOES matter on this one. Link to comment Share on other sites More sharing options...
jaclaz Posted July 29, 2010 Share Posted July 29, 2010 DOS or console inside 2K, XP etc.?If the latter (if you want a "cmd"....) ::loopECHO 1 = Run appECHO 2 = Run app w\switch /BECHO 3 = Exit.SET /P Mychoice=Please input a number IF %Mychoice%.==1. GOTO :Run_app_1IF %Mychoice%.==2. GOTO :Run_app_2IF %Mychoice%.==3. GOTO :just_exitCLS&GOTO :loop:Run_app_1ECHO This is Run_app_1GOTO :EOF:Run_app_2ECHO This is Run_app_2GOTO :EOF:just_exitECHO This is just_exitGOTO :EOFOR::loopECHO 1 = Run appECHO 2 = Run app w\switch /BECHO 3 = Exit.SET /P MyChoice=Please input a number FOR /L %%A IN (1,1,3) DO IF "%%A"=="%Mychoice%" GOTO :Choice_%MyChoice%CLS&GOTO :loop:Choice_1ECHO This is Choice_1GOTO :EOF:Choice_2ECHO This is Choice_2GOTO :EOF:Choice_3ECHO This is Choice_3GOTO :EOF Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted July 29, 2010 Author Share Posted July 29, 2010 Oooops I forgot it will be use on XP and later!THANK you so much. Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted July 29, 2010 Author Share Posted July 29, 2010 How do I get it to show just the options and not the path?Listem man I truly appreciate this. I would take way to long to finger this out. Link to comment Share on other sites More sharing options...
uid0 Posted July 29, 2010 Share Posted July 29, 2010 @echo offcls @ means the command will not be displayed, for that lineecho off means all subsequent commands will not be displayedcls clears the screen Link to comment Share on other sites More sharing options...
cluberti Posted July 29, 2010 Share Posted July 29, 2010 Add @echo off at the top. Link to comment Share on other sites More sharing options...
gunsmokingman Posted July 29, 2010 Share Posted July 29, 2010 Here is my effort at a cmd with choice@Echo Off:MainCLS && Color A9 && Title Main Menu && Mode 65, 9Echo.Echo Press 1 to install app no switchesEcho Press 2 to install app /swichesEcho Press 3 to exitEcho.SET Choice=SET /P Choice= Type Either 1 Or 2 Or 3 ^>^IF /I '%Choice%'=='1' GOTO 1IF /I '%Choice%'=='2' GOTO 2IF /I '%Choice%'=='3' GOTO 3::Incase The Input Was WrongCLS && Color 9b && Title Invalid Choice && mode 65,7ECHO.ECHO This reply %Choice% is not valid. Please try again.ECHO.ping -n 3 127.0.0.1>nulGOTO Main:: Choice 1:1CLS && Color F9 && Title Choice 1 Selected && mode 65,7Echo.Echo This will self close in 3 secondsEcho.ping -n 3 127.0.0.1>nul | set /p = Press Enter To CloseGoto :End:: Choice 2:2CLS && Color F8 && Title Choice 2 Selected && mode 65,7Echo.Echo This will self close in 3 secondsEcho.ping -n 3 127.0.0.1>nul | set /p = Press Enter To CloseGoto :End:: Choice 3:3CLS && Color F8 && Title Choice 3 Selected && mode 65,7Echo.Echo This will self close in 3 secondsEcho.ping -n 3 127.0.0.1>nul | set /p = Press Enter To CloseGoto :End:EndExit Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted July 30, 2010 Author Share Posted July 30, 2010 Hey thats pretty cool.Now if there was only a way to set the window size... Googled the hell outta that one and couldn't find an answer. Link to comment Share on other sites More sharing options...
ricktendo Posted July 30, 2010 Share Posted July 30, 2010 (edited) mode con: cols=100 lines=10 Edited July 30, 2010 by ricktendo64 Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted July 30, 2010 Author Share Posted July 30, 2010 (edited) Well sh*t on me...HEY Thanks guys!Here is the finished product!It is a Tiny SendTo addition to make Either DATA iso's from a folder or Bootable ISO's for Win2k, WinXP and Win2k3 (vbs by dumpy dooby)It is also uninstallable!Size - 264kb MD5 = e32f361b5836a2ecbedd96b5c6711a2d Edited July 30, 2010 by Kelsenellenelvian Link to comment Share on other sites More sharing options...
jaclaz Posted July 30, 2010 Share Posted July 30, 2010 I am missing the reason for the LCISOcreator.exe. A batch to launch a .vbs that launches mkisofs.exe....You could also add a .hta in the middle (just for the fun of it):http://mysite.verizon.net/hartsec/make.htmOr a Auto-it tool:http://www.solriche.co.uk/files/mgiso/mgiso.htmSeriously, you could ask, say, gunsmokingman to add the choices to the .vbs (and also remove the unneeded parts, getting rid of the batch) or, say, Yzöwl to add the mkisofs commands inside the batch (and get rid of the .vbs),right now there is an unneeded complication, as I see it.jaclaz Link to comment Share on other sites More sharing options...
Yzöwl Posted July 30, 2010 Share Posted July 30, 2010 I remember in the distant past, a topic for batches/infs for 'right click - create ISO' it also had option(s) for data and boot ISOs. Link to comment Share on other sites More sharing options...
jaclaz Posted July 30, 2010 Share Posted July 30, 2010 I remember in the distant past, a topic for batches/infs for 'right click - create ISO' it also had option(s) for data and boot ISOs.Yep , but that used CDIMAGE, and unless you are from MS you can't use it, mkisofs.exe is on the other hand completely free.http://www.msfn.org/board/index.php?showtopic=88660jaclaz Link to comment Share on other sites More sharing options...
gunsmokingman Posted July 30, 2010 Share Posted July 30, 2010 jaclazSeriously, you could ask, say, gunsmokingman to add the choicesVbs Code For Drap Drop Folder Or Open a Brows for Dialog, all that is neededis the code to make the iso. Const MyComp = &H11& Dim Boot, IsoFolder, Obj, Var If Wscript.Arguments.Count = 1 Then For Each Obj In WScript.Arguments If Right(InStr(Obj,"."),4) Or Right(InStr(Obj,"."),5) Then WScript.Echo "Error This Is Only For Folders Only" Else UserSelection(Obj) End If Next Else ManualSelectFolder() End If'-> Confirm Folder Path And Boot Or Data Iso Function ConfirmIt() If MsgBox("Is This The Correct Folder Path And Swich" & vbCrLf & IsoFolder,4132, "Results") = 6 Then If Boot Then MsgBox "Place Code To Make Boot Iso" & vbCrLf & "Bootable = " & Boot Else MsgBox "Place Code To Make Data Iso" & vbCrLf & "Bootable = " & Boot End If Else ManualSelectFolder() End If End function'-> User Choice Boot Data Quit Function UserSelection(Obj) Var = MsgBox( _ vbTab & "Make Iso Instructions" & vbCrLf & _ "Press Yes To Make A Bootable Iso" & vbCrLf & _ "Press No To Make A Data Iso" & vbCrLf & _ "Press Cancel To Exit Script" & vbCrLf & _ Obj, 4131,"Make Iso") If Var = 2 Then MsgBox "User Cancel Iso Creation", 4128,"Cancel Iso" WScript.Quit(0) ElseIf Var = 6 Then IsoFolder = Obj Boot = True ElseIf Var = 7 Then IsoFolder = Obj Boot = False End If ConfirmIt() End Function'-> Open A Brows For Folder Dialog Function ManualSelectFolder() Dim Shl :Set Shl = CreateObject("Shell.Application") Dim Fld :Set Fld = Shl.BrowseForFolder( _ 0, "Select The Iso Source Folder, Or Press Cancel To Exit Script And Do Nothing",16,MyComp) If Fld Is Nothing Then MsgBox "User Cancel Manual Add Folder",4128,"User Cancel" WScript.Quit(1) Else UserSelection(Fld.Items.Item.Path) End If End Function Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted August 3, 2010 Author Share Posted August 3, 2010 (edited) jaclazSeriously, you could ask, say, gunsmokingman to add the choicesVbs Code For Drap Drop Folder Or Open a Brows for Dialog, all that is neededis the code to make the iso. Const MyComp = &H11& Dim Boot, IsoFolder, Obj, Var If Wscript.Arguments.Count = 1 Then For Each Obj In WScript.Arguments If Right(InStr(Obj,"."),4) Or Right(InStr(Obj,"."),5) Then WScript.Echo "Error This Is Only For Folders Only" Else UserSelection(Obj) End If Next Else ManualSelectFolder() End If'-> Confirm Folder Path And Boot Or Data Iso Function ConfirmIt() If MsgBox("Is This The Correct Folder Path And Swich" & vbCrLf & IsoFolder,4132, "Results") = 6 Then If Boot Then MsgBox "Place Code To Make Boot Iso" & vbCrLf & "Bootable = " & Boot Else MsgBox "Place Code To Make Data Iso" & vbCrLf & "Bootable = " & Boot End If Else ManualSelectFolder() End If End function'-> User Choice Boot Data Quit Function UserSelection(Obj) Var = MsgBox( _ vbTab & "Make Iso Instructions" & vbCrLf & _ "Press Yes To Make A Bootable Iso" & vbCrLf & _ "Press No To Make A Data Iso" & vbCrLf & _ "Press Cancel To Exit Script" & vbCrLf & _ Obj, 4131,"Make Iso") If Var = 2 Then MsgBox "User Cancel Iso Creation", 4128,"Cancel Iso" WScript.Quit(0) ElseIf Var = 6 Then IsoFolder = Obj Boot = True ElseIf Var = 7 Then IsoFolder = Obj Boot = False End If ConfirmIt() End Function'-> Open A Brows For Folder Dialog Function ManualSelectFolder() Dim Shl :Set Shl = CreateObject("Shell.Application") Dim Fld :Set Fld = Shl.BrowseForFolder( _ 0, "Select The Iso Source Folder, Or Press Cancel To Exit Script And Do Nothing",16,MyComp) If Fld Is Nothing Then MsgBox "User Cancel Manual Add Folder",4128,"User Cancel" WScript.Quit(1) Else UserSelection(Fld.Items.Item.Path) End If End FunctionOK now this is awesome!What all code is needed from the previous makeiso.vbs?I mean I can add it all together but from previous posts and reading your script there is ALOT of waste in there.Can you cleanup and combine the old code and your code?Herte is the old code to make it easier on you:Option ExplicitDim fs, ws, arg, mypath, bootable, source, destination, label, mchar, params, LogFileSet fs = CreateObject("Scripting.FileSystemObject")Set ws = WScript.CreateObject("WScript.Shell")bootable = Falsemchar = 32source = Falsemypath = Left(WScript.ScriptFullName, Len(WScript.ScriptFullName) - ( Len(WScript.ScriptName) + 1 ) )Set LogFile = fs.OpenTextFile(mypath & "\log.txt",8,True,0)If WScript.Arguments.Count <> 0 Then For each arg in WScript.Arguments If Left(LCase(arg),2) = "/b" Or Left(LCase(arg),2) = "-b" Then bootable = True : mchar = 16 ElseIf fs.FolderExists(arg) Then source = fs.GetAbsolutePathName(arg) ElseIf fs.FileExists(arg) Then source = fs.GetAbsolutePathName(fs.GetParentFolder(arg)) ElseIf Right(arg,2) = ":\" Then LogFile.WriteLine(Date & " " & Time & " - Launching: " & mypath & "\LCISOCreator.exe") ws.Run Chr(34) & mypath & "\LCISOCreator.exe" & Chr(34) , 1 , False WScript.Quit Else WScript.Echo "Invalid argument <" & arg & ">" LogFile.WriteLine(Date & " " & Time & " - Non-Fatal Error: Invalid argument. <" & arg & ">") End If NextEnd IfIf Not VarType(source) = 8 Then WScript.Echo "Source folder not specified!" LogFile.WriteLine(Date & " " & Time & " - Fatal Error: Source folder not specified!") WScript.QuitEnd Ifws.CurrentDirectory = sourcelabel = fs.GetFileName(source)Do If Len(label) > mchar Then If LCase(Right(WScript.FullName,12)) = "\cscript.exe" Then WScript.StdOut.Write VBCrLf & " Please enter a label for the ISO." & VBCrLf & " Label cannot be longer than " & mchar & " characters." & VBCrLf & VBCrLf & " >" label = WScript.StdIn.ReadLine Else label = InputBox("Please enter a label for the ISO." & VBCrLf & "Label canot be longer than " & mchar & " characters.") End If Else Exit Do End If If IsEmpty(label) Then label = " "Loopparams = " -iso-level 2 -J -joliet-long -l -D -relaxed-filenames -N -V " & Chr(34) & label & Chr(34) & " -v -x thumbs.db -o ..\" & fs.GetBaseName(source) & ".iso ."If bootable Then If fs.FileExists(mypath & "\xpBoot.img") Then fs.CopyFile mypath & "\xpBoot.img", source & "\" Else WScript.Echo "Error! Cannot create bootable XP disc without XP boot image! <xpBoot.img>" LogFile.WriteLine(Date & " " & Time & " - Non-Fatal Error: Bootable discs cannot be created without a proper boot image.") LogFile.WriteLine(Date & " " & Time & " - The script will still attempt to execute on the chance that the image is present in the source directory.") End If params = " -b " & Chr(34) & "xpBoot.img" & Chr(34) & " -iso-level 2 -relaxed-filenames -joliet-long -N -d -duplicates-once -D -boot-load-seg 0x7C0 -boot-load-size 4 -hide xpBoot.img -hide boot.catalog -J -hide-joliet xpBoot.img -hide-joliet boot.catalog -no-emul-boot -volid " & Chr(34) & label & Chr(34) & " -sysid " & Chr(34) & "Win32" & Chr(34) & " -v -x thumbs.db -o ..\" & fs.GetBaseName(source) & ".iso ."End Ifws.Run Chr(34) & mypath & "\mkisofs.exe" & Chr(34) & params , 10 , TrueLogFile.WriteLine(Date & " " & Time & " - Command Executed: " & Chr(34) & mypath & "\mkisofs.exe" & Chr(34) & params)If fs.FileExists(source & "\xpBoot.img") Then fs.DeleteFile source & "\xpBoot.img", TrueWScript.QuitAlso this "LCISOcreator.exe" is this part even needed?If no can you remove the relevant code? Edited August 3, 2010 by Kelsenellenelvian Link to comment Share on other sites More sharing options...
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