From 647f83a021e7be535bf28a15b8e4cb0e49467262 Mon Sep 17 00:00:00 2001 From: claustromaniac <20734810+claustromaniac@users.noreply.github.com> Date: Sat, 11 Aug 2018 22:55:51 -0300 Subject: [PATCH] change working dir to script dir The working dir doesn't necessarily match the script's path, depending on how the script is called. All relative paths and conditional statements using EXIST will fail whenever the working dir is not the script's own location. This fixes that. --- prefsCleaner.bat | 6 ++++-- updater.bat | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/prefsCleaner.bat b/prefsCleaner.bat index 6e0875d..4c8f7a4 100644 --- a/prefsCleaner.bat +++ b/prefsCleaner.bat @@ -3,7 +3,9 @@ TITLE prefs.js cleaner REM ### prefs.js cleaner for Windows REM ## author: @claustromaniac -REM ## version: 2.1 +REM ## version: 2.2 + +CD /D "%~dp0" :begin ECHO: @@ -11,7 +13,7 @@ ECHO: ECHO ######################################## ECHO #### prefs.js cleaner for Windows #### ECHO #### by claustromaniac #### -ECHO #### v2.1 #### +ECHO #### v2.2 #### ECHO ######################################## ECHO: CALL :message "This script should be run from your Firefox profile directory." diff --git a/updater.bat b/updater.bat index 650a20a..2b09aae 100644 --- a/updater.bat +++ b/updater.bat @@ -7,6 +7,7 @@ REM ## version: 4.6 REM ## instructions: https://github.com/ghacksuserjs/ghacks-user.js/wiki/3.3-Updater-Scripts VERIFY ON +CD /D "%~dp0" SET _myname=%~n0 SET _myparams=%* :parse