aboutsummaryrefslogtreecommitdiffstats
path: root/uiautomatorviewer/etc/uiautomatorviewer.bat
diff options
context:
space:
mode:
Diffstat (limited to 'uiautomatorviewer/etc/uiautomatorviewer.bat')
-rwxr-xr-xuiautomatorviewer/etc/uiautomatorviewer.bat5
1 files changed, 4 insertions, 1 deletions
diff --git a/uiautomatorviewer/etc/uiautomatorviewer.bat b/uiautomatorviewer/etc/uiautomatorviewer.bat
index 28bc44e..f3f5d47 100755
--- a/uiautomatorviewer/etc/uiautomatorviewer.bat
+++ b/uiautomatorviewer/etc/uiautomatorviewer.bat
@@ -24,6 +24,9 @@ rem Change current directory and drive to where the script is, to avoid
rem issues with directories containing whitespaces.
cd /d %~dp0
+rem Get the CWD as a full path with short names only (without spaces)
+for %%i in ("%cd%") do set prog_dir=%%~fsi
+
rem Check we have a valid Java.exe in the path.
set java_exe=
call lib\find_java.bat
@@ -60,4 +63,4 @@ if exist %swt_path% goto SetPath
:SetPath
set javaextdirs=%swt_path%;%frameworkdir%
-call %java_exe% -Djava.ext.dirs=%javaextdirs% -Dcom.android.uiautomator.bindir= -jar %jarpath% %*
+call %java_exe% -Djava.ext.dirs=%javaextdirs% -Dcom.android.uiautomator.bindir=%prog_dir% -jar %jarpath% %*