I am creating a batch file that when a user runs it a file included in the folder is unzipped.
So like this:
Downloaded_Folder | Batch.bat | ZippedFile.zip
Though when I run the powershell command to unzip the powershell is ran from System32. I am also unsure where the user will be opening this folder from (Their downloads, or desktop, or documents?)
Here is what I have:
openfiles > NUL 2>&1
if NOT %ERRORLEVEL% EQU 0 goto NotAdmin
echo Hello from elevated command prompt
powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('foo.zip', 'bar'); }"
goto End
:NotAdmin
echo This command prompt is NOT ELEVATED
pause
:End
pause