Jump to content

Recommended Posts

Posted

Hi, for my first post i would like to thanks this community for the informations that powered ( sorry for English, i'm French ). So i have just a question, i have by batch like that :

echo.
echo VideoLan Player VLC0.81
start /wait %systemdrive%\applications\vlc-0.8.1-win32.exe /S
echo.
echo Amsn0.94
start /wait %systemdrive%\applications\Amsn-Pack-0.94.exe /n /S
echo.  
....

I want to know if its possible in the batch to makin choice by o/n. Like

Would you like to install ... ? [o/n]

if o is pressed the software is installed if n the bacth ignore install and go to the next software

Thanks :w00t:


Posted

You mean something like this

set choice=
set /p choice=Do you want to install VideoLan Player (y/n)?
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='y' goto Yes
if '%choice%'=='n' goto Amsn
:Yes
start /wait %systemdrive%\applications\vlc-0.8.1-win32.exe /S
goto Amsn
:Amsn
set choice=
set /p choice=Do you want to install blah, blah (y/n)?
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='y' goto Yes
if '%choice%'=='n' goto NextItem
....
....

Posted

just an additional two-cents question here

had been using the command choice for 9x and 2003 and was a little annoyed that there's no choice command by default for xp...

is there a timeout for the set /p command?

i.e. if the user doesn't answer in x seconds then option x is chosen by default (like the choice command does)

Many thanks,

Nath.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...