how make "are you sure" prompt in windows batchfile windows 7


  1. Posts : 28
    Windows 7 ultimate 32bit
       #1

    how make "are you sure" prompt in windows batchfile windows 7


    are running windows 7, got some problem get it work.. have read somthing of commmands thats ben removed in later windows this is what i'm working on...

    MS-DOS choice command help

    Code:
     @echo off 
    set /p var=Are You Sure?[Y/N]:  if %var%== Y goto RestOffProrram if not %var%== Y exit
    
    RestOfProgram:
    echo here goes the program codde
    PAUSE
      My Computer


  2. Posts : 7,107
    W7 home premium 32bit/W7HP 64bit/w10 tp insider ring
       #2

    You dont need to

    UAC set to normal will automatically give you the option.

    What are you trying to do

    Roy

    note incorrect spelling will cause the command to fail
      My Computer


  3. Posts : 28
    Windows 7 ultimate 32bit
    Thread Starter
       #3

    Have done a small script for backup purposes because the script moves all users files and then deletes them from the c: i want to make sure that the user approves it .. feels a bit like half-time programming otherwise

    The problem is that I run the script as admin and then it does not ask if it's okay that the original files are deleted.


    my backup script using robocopy Solved - Windows 7 Help Forums
      My Computer


  4. Posts : 28
    Windows 7 ultimate 32bit
    Thread Starter
       #4

    Nobody doing batch?
      My Computer


  5. Posts : 3,787
    win 8 32 bit
       #5

    Why dont you move onto https://www.autoitscript.com/site/autoit/ it compiles to an exe with lots more cmds very simple to write lots of examples https://www.autoitscript.com/autoit3...zip/winzip.htm
      My Computer


  6. Posts : 28
    Windows 7 ultimate 32bit
    Thread Starter
       #6

    Ok..
      My Computer


  7. Posts : 7,351
    Windows 7 HP 64
       #7

    Using batch files

    You can use "if"
      My Computers


  8. Posts : 28
    Windows 7 ultimate 32bit
    Thread Starter
       #8

    Megahertz07 said:
    Using batch files

    You can use "if"
    nice.. trying låter. .
      My Computer


  9. Posts : 28
    Windows 7 ultimate 32bit
    Thread Starter
       #9

    choice /c YN /n /m "Do you want to shutdown computer? (Yes/No) "
    if %errorlevel% EQU 1 goto doreboot
    if %errorlevel% EQU 2 goto close

    echo.An unexpected error has occurred.
    echo.
    echo.Press any key to continue . . .
    pause>nul
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 09:51.
Find Us