Solved Question of full path of file

March 20, 2014 at 01:30:15
Specs: Windows 7
Hi,
tell me how can I create batch file to ask user of full path of MySetup.exe.
It will be good thaht this directory will be as parameter.

Thanks a lot


See More: Question of full path of file

Report •


#1
March 20, 2014 at 11:22:58
✔ Best Answer
When I've done this in the past, I used a parameter. For example:

set /p filepath=Enter File Path to MySetup.exe and press Enter: 

Which will display like this: "Enter File Path to MySetup.exe:" and will wait for the user to enter the file path and hit enter on their key. It will store it like this: %filepath%

So you could use it like this:

del C:\users\bob\%filepath%\MySetup.exe

or

del %filepath%\MySetup.exe

However it works best for your batch file!

Law of Logical Argument: Anything is possible if you don't know what you're talking about.


Report •

#2
March 20, 2014 at 12:46:59
You could also add a loop
:begins
set filepath=""
set /p filepath="Enter File Path to MySetup.exe and press Enter: "
if not exist %filepath% echo that path is not found && goto begins

::mike


Report •

Related Solutions


Ask Question