这里是一个批处理脚本,可以拖放任何文件与Notepad.exe
打开它,如果传递的参数是一个文件夹,它会与Explorer.exe
@echo off
Title Drag and drop a file to open with Notepad
Mode con cols=60 lines=3
IF [%1] EQU [] Goto:Error
CD /D "%~1">nul 2>&1 && Goto:Explorer_Folder || Goto :OpenFile
Exit /b
::**********************************************************
:OpenFile <File>
Start "Drag and Drop" "%windir%\system32\Notepad.exe" "%~1"
Exit /b
::**********************************************************
:Explorer_Folder <Folder>
Explorer "%~1"
Exit /b
::**********************************************************
:Error
Color 0C & echo(
ECHO You must drag and drop a file on this batch program
Timeout /T 5 /NoBreak >nul
Exit /b
::**********************************************************
打开要访问拖动文件的例子并放在一个批处理文件中,将其称为['%1'](http://ss64.com/nt/syntax-args.html)(另请参阅'call/?'获取更多信息);你可以在你的批处理文件中写入''D:\ path \ to \ your \ program.exe“”%〜1“'用'program.exe'打开文件... – aschipfl