batch menu input

June 26, 2009 at 02:28:35
Specs: Windows XP
Hello computing.net go'ers!

I may not look like it but im an older member, used to be Greaper6/Genocide. Anyways, i used to batch files long ago and since then seem to have forgotten how to do somethings.

What I ask of you now is to help me relearn and unlock my old memories of batch, the first thing out of many questions i have is how to make a menu query input. Thats the best way i know how to say it, but if u dnt knw what that is let me show you.

I want to do something like the following:


Enter Drive Letter: (User {Input1=%1%})
Enter Folder: (User {Input2=%2%})

@MKDIR "%1%:\%2%"

So that would be mkdir C:\folder


you know?

for a more complicated example I would like to do this..

Which Drive=: C
Which Path=: Folder
Other settings (If any):
User: Admin
Perm: FULL

@cacls "%drive%:\%path%" %other settings% %user%:%Permission%


well anyways, thats it, lemme know plz and thnx in advance.
Which would be


See More: batch menu input

Report •


#1
June 26, 2009 at 04:36:40
set /p d= drive ? :
set /p f= folder ? :
:: and so on


=====================================
If at first you don't succeed, you're about average.

M2


Report •

#2
June 26, 2009 at 04:38:52
Hey Thnx M2, i like noticed it about 5 min after i made the post :P

Report •

#3
June 26, 2009 at 08:58:09
Well here is the end product of this request. Well, not rly END, but u knw.

http://www.youtube.com/watch?v=glds...


Report •

Related Solutions

#4
June 28, 2009 at 01:26:23
What I have so far.

@ECHO OFF

@for /f "skip=4 tokens=2* delims= " %%a in ('2^>nul reg query "hklm\software\CaclsUI" /v "runonce"') do (
if /i "%%a"=="reg_sz" if "%%b"=="1" goto STRT21
)
goto INTRO
@CLS


:INTRO
@reg add hklm\software\CaclsUI /v runonce /t reg_sz /d 1 >>NUL
@Title Introduction Of:
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:1 0 1 1 0 1 0 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:1 0 1 1 0 1 1 1 0:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:0 1 1 0 1 0 1 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:1 0 0 1 1 0 0 1 1:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:1 0 1 1 0 0 0 1 1:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:0 1 1 1 0 1 0 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:1 0 1 1 0 1 0 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:0 0 1 1 0 0 0 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:1 0 1 1 0 1 1 1 0:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:1 0 1 1 0 1 0 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:1 0 1 1 0 1 1 1 0:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:0 1 1 0 1 0 1 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:1 0 0 1 1 0 0 1 1:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:1 0 1 1 0 0 0 1 1:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:0 1 1 1 0 1 0 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:1 0 1 1 0 1 0 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:0 0 1 1 0 0 0 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:1 0 1 1 0 1 1 1 0:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I 0 1 1 0 1 0 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:1 0 1 1 0 1 0 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N 1 1 0 1 1 1 0:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:I 0 1 1 0 1 1 1 0:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 0 1 0 1 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N 1 0 1 0 1 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 1 0 0 1 1:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 0 1 0 0 1 1:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C 0 0 1 1:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 1 0 0 1 1:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T 0 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C 1 0 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T 0 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T 1 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T 1 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 1:.
@ECHO ===========================
@Ping.exe localhost -n 0 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C # I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I # J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J # C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 # T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 #:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I # N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:# N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N # 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T # 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C # I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I # J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J # C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 # T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 #:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I # N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:# N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N # 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T # 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 1 >NUL
@CLS
@ECHO ===========================
@ECHO .:I N J 3 C T I 0 N:.
@ECHO ===========================
@Ping.exe localhost -n 4 >NUL
@ECHO.
@ECHO.
@ECHO This UI can cause harmfull damage to your
@ECHO Warning: computer, please excersice caution with contiuous
@ECHO use of this GUI.
@ECHO.
@ECHO (And when I say harfull, I mean make it so that you
@echo can't access files and folders if you mess up)
@echo.
@echo.
@ECHO -Inj3cti0n
@Echo.
@Echo.
@Pause


@Goto STRT21
:notes
@CLS
@ECHO /////////////
@ECHO // Notes:
@ECHO //
@ECHO // lol, If Any? Idk!~~!
@ECHO //
@ECHO //
@ECHO //
@ECHO // I hope you people like this damn thing,
@ECHO // it took me for ever to get it done right
@ECHO // so everything worked accordingly ffs.
@ECHO //
@ECHO // "I had man FML's"
@ECHO // -Inj3cti0n
@ECHO //
@ECHO //
@ECHO //
@ECHO // Side Note: I f---ING GOT IT!! =]
@ECHO //
@ECHO /////////////

@PAUSE > NUL
@CLS

:STRT21
@CLS
@Title Access Control Lists UI = (B:%random%)


@ECHO.
@ECHO.
@ECHO -=[ --------------------- ]=-

@ECHO Created By: Inj3cti0n

@ECHO -=[ --------------------- ]=-
@ECHO.
@ECHO.

@ECHO Todays Date / Time
@ECHO %date% / %time%
@ECHO.
@ECHO.
@ECHO.
@Echo I'd like to thank all the people involved
@echo with making this Batch file, not just the
@echo ones that actually coded it but all the ones
@echo that had things out there that I found and read.
@ECHO.
@ECHO.
@ECHO.
@echo # / Name / Purpose
@ECHO :[1]: Inj3cti0n - Programmer
@ECHO :[2]: Tekky - Programmer and Reviewer
@ECHO.
@ECHO Each person has a little info about them here,
@echo which persons info would you like to see?
@ECHO.
@SET /p name= # (Which Number?): "Currently Disabled - Press ENTER!"
@ECHO.
@ECHO.
@CLS
@ECHO.
@ECHO Tip: I wonder whats in the "notes" drive?
@ECHO.
@ECHO Please Wait...
@Ping.exe localhost -n 3 >NUL
@ECHO.
@ECHO.
@ECHO.
@ECHO.

@ECHO The purpose of CACLS is:
@ECHO.
@ECHO To Display or modify the access control
@ECHO lists (ACLs) of files.
@ECHO.
@ECHO -Microsoft
@ECHO.
@ECHO ---------------------------------
@ECHO.
@ECHO The purpose of this UI is:
@ECHO.
@Echo I made this GUI only because I discovered
@echo the CMD "CACLS." I decided to do it, ONLY,
@echo out bordom and because I wanted to try my
@echo hand at making batch files, once again.
@echo.
@echo.
@echo -Inj3cti0n
@ECHO ---------------------------------
@ECHO Please Wait...
@Ping.exe localhost -n 5 >NUL
@CLS

@ECHO.
@ECHO.
@ECHO Info: Most Pc users MAIN HDD is drive "C", however
@echo more advanced Pc users have either a different drive
@echo as there Main HDD or/and a external.
@ECHO.
@ECHO Ecample: C, D, E, F, G. (And so on)
@echo.
@SET /p DRIVE= Drive (LETTER ONLY!):
@IF %DRIVE%==notes goto notes
@CLS
@ECHO.
@ECHO.
@ECHO ===========================
@ECHO Currently Selected: %DRIVE%:\
@ECHO ===========================
@ECHO.
@ECHO Info: Paths would be what comes after the DRIVE letter,
@echo like "Program Files", "Documents and Settings", or
@ECHO "WINDOWS."
@ECHO.
@ECHO.
@SET /p PATH= Enter Path:


@CLS
@ECHO.
@ECHO.
@ECHO ===========================
@ECHO Currently Selected: %DRIVE%:\%PATH%
@ECHO ===========================
@ECHO.
@ECHO.
@echo Which user would you like to change access rights to?
@ECHO.
@C:\WINDOWS\system32\NET.EXE USER
@ECHO.
@ECHO.
@SET /p USER= UserName:

@ECHO your about to do %DRIVE%-%PATH%-%USER%
@pause
@@C:\WINDOWS\system32\CACLS.EXE "%DRIVE%:\%PATH%" /T /E /G %USER%:F

________________________________________

The batch is yet complete so dont complain :P if you have any suggestions, im all ears.


Report •


Ask Question