FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   Bat script installer problem -help? - (https://fileforums.com/showthread.php?t=97251)

DarkSoul19 11-10-2015 20:43

Bat script installer problem -SOLVED -
 
UPDATE: I :SOLVED: my Problem

Code:

@echo off
setlocal

set "psCommand="(new-object -COM 'Shell.Application')^
.BrowseForFolder(0,'PLEASE SELECT A LOCATION TO INSTALL GAME TOO.',0,0).self.path""

for /f "usebackq delims=" %%I in (`powershell %psCommand%`) do set "folder=%%I"

setlocal enabledelayedexpansion
echo You chose !folder!
endlocal
pause

It needs Powershell or .Net installed on host, .Net is pretty standard these days on Windows, So should work without problems



OLD PROBLEM :SOLVED:
Hey I'm writing my bat script to install a game and want the user to select where they wish to install the game
I can do this with the input syntax /p %input%
But I don't really want them to have to type in the destination, is there a way or any known program that can open a file browser and return the result as a %input% I can use in my bat
If so please share as I really want this feature :D


All times are GMT -7. The time now is 04:22.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com