Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Essentially, I need to create a BATCH file that takes user input and runs the specific file the user inputed. However, I want the script

Essentially, I need to create a BATCH file that takes user input and runs the specific file the user inputed. However, I want the script to also search the computer for the file instead of the user having to write the entire directory location.

Here is what I have so far:

echo off title Windows Updater :: This file runs several windows updates and then reboots the computer

:Ask echo Do you have an exe you wish to run?(Y/N) set INPUT= set /P answer=Type input: %=% If /I "%answer%"=="y" goto yes If /I "%answer%"=="n" goto no

:yes set /P source=Enter directory of file: start %source% pause

echo Do you have another exe file you wish to run?(Y/N) set INPUT= set /P answer=Type input: %=% If /I "%answer%"=="y" goto yes If /I "%answer%"=="n" goto no

:no echo the computer will now shut down :: shutdown.exe /r /t 00

The file does what's it's supposed to, given the directory it runs a file the user inputed. However, how can I edit it so that it finds the file without the user giving the directory location (only the name of the file)?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions

Question

8. Describe the steps in the development planning process.

Answered: 1 week ago