Everything Else > Computers and Technology

Another useful "file explorer"

(1/1)

benthecomputerguy93:
Here's just a simple batch script that I found on the internet and changed slightly for my own use. It uses powershell to invoke the openfiledialog() function. This is extremely useful in situations where windows explorer is unavailable on a system, either because of an infection or because its server core edition and thus missing or something along those lines.


--- Code: ---@echo off
color 0a
echo.
echo Errors and messages will be outputted here.
echo.
setlocal
:top
set filename=
set ps_cmd=powershell "Add-Type -AssemblyName System.windows.forms|Out-Null;$f=New-Object System.Windows.Forms.OpenFileDialog;$f.Filter='All files (*.*)|*.*';$f.showHelp=$true;$f.ShowDialog()|Out-Null;$f.FileName"

for /f "delims=" %%I in ('%ps_cmd%') do set "filename=%%I"

if defined filename (
    start %filename%
goto top
)
--- End code ---

Maybe someone else can use it!

Floyd:
neat!

wow two new posts by someone other than me in one year? that's a record that hasn't been beat since like 2012

benthecomputerguy93:
Haha well I found the place and thought that it was kinda cool. Then I changed jobs from the one that brought me to find this place so I forgot about it for a couple months. I had thought about just dumping my thoughts relating to stuff like this into here, both to help me organize them a little better but also to share them. I'll get a forum of my own for this someday haha but thats not a top priority for me right now.

Navigation

[0] Message Index

Go to full version