Page 1 of 1

Unlocker

Posted: 13 May 2020 11:42
by Docfxit
I would like to get Unlocker working.
My preference would be to get Unlocker to delete files from a list of files that are written to a file.
I can't seem to get Unlocker working from a batch file no matter what command line parameters I give it.
In these examples none of them work when I start the bat file with Run As Administrator.

Code: Select all

@Echo Off
C:\Programs\Unlocker\Unlocker.exe "C:\Dnload\9xAddons\UnlockerListofFiles.txt" /O /L /D
C:\Programs\Unlocker\Unlocker.exe "C:\$WINDOWS.~BT\Sources\SetupPlatform.ini" /D
cd\Programs\Unlocker
Unlocker.exe "C:\$WINDOWS.~BT\Sources\SetupPlatform.ini" /O /L /D
if not exist "C:\$WINDOWS.~BT\Sources\Panther\." (
	Echo "C:\$WINDOWS.~BT\Sources\Panther" Was Deleted
)
C:\Programs\Notepad++\notepad++.exe C:\Programs\Unlocker\Unlocker-Log.txt
cmd/k
What I have in the txt file "UnlockerListofFiles.txt"

Code: Select all

C:\$WINDOWS.~BT\Sources\example.au3
C:\$WINDOWS.~BT\Sources\Panther
C:\$WINDOWS.~BT\Sources\ProcessEx.au3
C:\$WINDOWS.~BT\Sources\SetupPlatform.ini
UnlockerCommandLine.jpg
UnlockerCommandLine.jpg (81.39 KiB) Viewed 7600 times
Thanks,

Re: Unlocker

Posted: 16 May 2020 02:48
by jfl
What you need is a (for /f ...) command. Ex:

Code: Select all

for /f "delims=" %%f in ("UnlockerListofFiles.txt") do (
  C:\Programs\Unlocker\Unlocker.exe "%%~f"
)

Re: Unlocker

Posted: 16 May 2020 11:03
by Docfxit
Thank you for the suggestion...

I modified your code a little to prove it was working as expected:

Code: Select all

for /f "delims=" %%f in ("UnlockerListofFiles.txt") do (
  Echo "%%~f"
  C:\Programs\Unlocker\Unlocker.exe "%%~f"
)
In the cmd window this is what I got:

Code: Select all

C:\Programs\Unlocker>for /F "delims=" %f in ("UnlockerListofFiles.txt") do (
Echo "%~f"
 C:\Programs\Unlocker\Unlocker.exe "%~f"
)

C:\Programs\Unlocker>(
Echo "UnlockerListofFiles.txt"
 C:\Programs\Unlocker\Unlocker.exe "UnlockerListofFiles.txt"
)
"UnlockerListofFiles.txt"
What I expected was for each line within the file UnlockerListofFiles.txt to be listed.
I think you also wanted to add the paramater " /D" so it would delete the files.

Thanks,

Re: Unlocker

Posted: 16 May 2020 14:45
by ShadowThief
Based on the picture you've shown, you need the /S option to hide the GUI, and the file containing the files to unlock goes after the /L option.

Code: Select all

unlocker.exe /L UnlockerListofFiles.txt /O /D /S

Re: Unlocker

Posted: 16 May 2020 15:03
by Docfxit
ShadowThief wrote:
16 May 2020 14:45
Based on the picture you've shown, you need the /S option to hide the GUI, and the file containing the files to unlock goes after the /L option.

Code: Select all

unlocker.exe /L UnlockerListofFiles.txt /O /D /S
Great observation. I still couldn't get it to delete the files/partition.

The next thing I tried was:

Code: Select all

C:\Programs\Unlocker\Unlocker.exe /L "C:\Dnload\9xAddons\UnlockerListofFiles.txt" /O /D /S
It didn't work either. and I did run it As Administrator.
The user I am has Administrator rights.

Thanks,

Re: Unlocker

Posted: 16 May 2020 18:08
by ShadowThief
Based on my tests, it seems that you need the -option format instead of the /option format for flags.

Code: Select all

unlocker.exe "list_of_files.txt" -L -S -D -O
deleted the files listed and created an output log, but

Code: Select all

 unlocker.exe "list_of_files.txt" /L /S /D /O
did nothing.

Re: Unlocker

Posted: 16 May 2020 19:13
by Docfxit
ShadowThief wrote:
16 May 2020 18:08
Based on my tests, it seems that you need the -option format instead of the /option format for flags.

Code: Select all

unlocker.exe "list_of_files.txt" -L -S -D -O
deleted the files listed and created an output log
You are a miracle worker. That works perfect.
I tried dashes before. I must have not had the correct combination.
You did really great. Thank you very very much.

Docfxit