Command Prompt automation

Posted on 2007-08-07
Last Modified: 2010-04-16
i have to run a command thru command prompt which i think runs a batch file. i would like to have this automated and put on a icon where i can double click it on my desktop and it runs.
Question by:tomasdlv
    LVL 30

    Expert Comment

    Create you batch file. Here's an example:

    @echo off



    Right-click on desktop and select New --> Shortcut.

    Enter the fully qualified name of the batch file. Like c:\temp\temp.bat

    Give it a name.

    There you go!

    Author Comment

    this is great!!

    how do i make it say something for example a pause and then say "this will run this command ...sure to continue  y or n" and then accept an anwser.
    LVL 30

    Accepted Solution

    @echo off


    set ans=

    set /p ans=This will run this command. Are you sure you want to run it (Y/N)?

    if /i not "%ans%"=="Y" goto :EOF

    REM ** Place the command here

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
    Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now