Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - benthecomputerguy93

Pages: [1]
Computers and Technology / Another useful "file explorer"
« 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 Errors and messages will be outputted here.
set filename=
set ps_cmd=powershell "Add-Type -AssemblyName|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!
Pages: [1]