Frage von CoolCrafter584, 29

Command Nicht gefunden?

Ich habe bei mir eine Batch datei, welche ich ausführen muss(Weswegen ist egal). Nur wenn ich sie ausführe, steht in der Befehlszeile: Der Befehle "BrowseForFolder" ist entweder falsch geschrieben oder konnte nicht gefunden werden. Brauche bitte dringend hilfe, weil ich mein Ding so schnell wie möglich beenden will mit dieser Datei. Danke schonmal im Vorraus.

HIer der Code:

@echo offsetlocal::Select the path to steam folderset "psCommand="(new-object -COM 'Shell.Application')%psCommand%.BrowseForFolder(0, Please select the root folder for steam (ex: c:\Program Files (x86)\steam).',0,0).self.path""for /f "usebackq delims=" %%I in (%psCommand%) do set "STEAM_ROOT_PATH=%%I"IF NOT DEFINED STEAM_ROOT_PATH (goto failure)IF EXIST "%STEAM_ROOT_PATH%\steamapps\common\OpenVR" GOTO use_openvrIF EXIST "%STEAM_ROOT_PATH%\steamapps\common\SteamVR" GOTO use_steamvrgoto no_steamvr_installed:no_steamvr_installedecho "No steamvr folder found at %STEAM_ROOT_PATH%! Please install steamvr."goto failure:use_openvrset STEAMVR_RUNTIME_DIR=%STEAM_ROOT_PATH%\steamapps\common\OpenVRgoto write_set_drivers_script:use_steamvrset STEAMVR_RUNTIME_DIR=%STEAM_ROOT_PATH%\steamapps\common\SteamVRgoto write_set_drivers_script:write_set_drivers_scriptecho "Found SteamVR Runtime Dir: %STEAMVR_RUNTIME_DIR%":: Write out the paths to a config batch filedel SteamVR_SetDriverVarsWin32.batecho @echo off >> SteamVR_SetDriverVarsWin32.batecho set INSTALL_DIR=%STEAMVR_RUNTIME_DIR%\drivers\psmove>> SteamVR_SetDriverVarsWin32.batecho set STEAMVR_RUNTIME_DIR=%STEAMVR_RUNTIME_DIR%>> SteamVR_SetDriverVarsWin32.bat:: Copy over the openvr driverscall SteamVR_ReinstallDriverWin32.batpausegoto exit:failurepausegoto exit:exitendlocal
Antwort
von ymicky, 19

Der Quellcode wäre hilfreich :)

Kommentar von CoolCrafter584 ,
@echo off
setlocal

::Select the path to steam folder
set "psCommand="(new-object -COM 'Shell.Application')
%psCommand%.BrowseForFolder(0, Please select the root folder for steam (ex: c:\Program Files (x86)\steam).',0,0).self.path""
for /f "usebackq delims=" %%I in (%psCommand%) do set "STEAM_ROOT_PATH=%%I"
IF NOT DEFINED STEAM_ROOT_PATH (goto failure)

IF EXIST "%STEAM_ROOT_PATH%\steamapps\common\OpenVR" GOTO use_openvr
IF EXIST "%STEAM_ROOT_PATH%\steamapps\common\SteamVR" GOTO use_steamvr
goto no_steamvr_installed

:no_steamvr_installed
echo "No steamvr folder found at %STEAM_ROOT_PATH%! Please install steamvr."
goto failure

:use_openvr
set STEAMVR_RUNTIME_DIR=%STEAM_ROOT_PATH%\steamapps\common\OpenVR
goto write_set_drivers_script

:use_steamvr
set STEAMVR_RUNTIME_DIR=%STEAM_ROOT_PATH%\steamapps\common\SteamVR
goto write_set_drivers_script

:write_set_drivers_script
echo "Found SteamVR Runtime Dir: %STEAMVR_RUNTIME_DIR%"

:: Write out the paths to a config batch file
del SteamVR_SetDriverVarsWin32.bat
echo @echo off >> SteamVR_SetDriverVarsWin32.bat
echo set INSTALL_DIR=%STEAMVR_RUNTIME_DIR%\drivers\psmove>> SteamVR_SetDriverVarsWin32.bat
echo set STEAMVR_RUNTIME_DIR=%STEAMVR_RUNTIME_DIR%>> SteamVR_SetDriverVarsWin32.bat

:: Copy over the openvr drivers
call SteamVR_ReinstallDriverWin32.bat
pause
goto exit

:failure
pause
goto exit

:exit
endlocal
Kommentar von ymicky ,

Okay. Sry da kann ich dir nicht helfen, da ich nicht so tief im Batchskripting drin stecke ^^

Keine passende Antwort gefunden?

Fragen Sie die Community

Weitere Fragen mit Antworten