co1 message board

Everything Else => Computers and Technology => Topic started by: benthecomputerguy93 on January 07, 2016, 11:30:09 am

Title: Another useful "file explorer"
Post by: benthecomputerguy93 on January 07, 2016, 11:30:09 am
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: [Select]
@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
)

Maybe someone else can use it!
Title: Re: Another useful "file explorer"
Post by: Floyd on January 19, 2016, 04:50:22 pm
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
Title: Re: Another useful "file explorer"
Post by: benthecomputerguy93 on April 03, 2016, 08:37:20 pm
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.