2015-07-03 157 views
0

我用我自己的URI方案從瀏覽器中打開外部視頻播放YouTube視頻後(potplayer:// https://www.youtube.com/watch?v= *******):關閉CMD啓動程序

Windows Registry Editor Version 5.00 

[HKEY_CLASSES_ROOT\potplayer] 
@="\"URL:potplayer protocol\"" 
"URL Protocol"="" 

[HKEY_CLASSES_ROOT\potplayer\shell] 

[HKEY_CLASSES_ROOT\potplayer\shell\open] 

[HKEY_CLASSES_ROOT\potplayer\shell\open\command] 
@="cmd /c (set \"var=%1\" & call set var=%%var:potplayer://=%% && call C:\\PotPlayer\\PotPlayer.exe %%var%%)" 

它開始cmd從「potplayer:// https://www.youtube.com/watch?v= *******」中刪除「potplayer://」

只有在視頻播放器(PotPlayer.exe)關閉時纔會關閉cmd。但是在視頻播放器啓動後,cmd應該立即關閉。

+0

開始/ B可用於執行應用這種方式。不幸的是我不確定,如果你可以在你的情況下用開始替換cmd。另請參閱:http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/start.mspx?mfr=true – RhinoDevel

+0

「替換cmd」您是什麼意思?它不能被替換。無論如何CMD必須啓動。開始/ b可以在批處理文件中使用,無需打開cmd窗口即可啓動程序 – user25

回答

0

解決了這個:

[HKEY_CLASSES_ROOT\potplayer\shell\open\command] 
@="cmd /c (set var=%1 & call set var=%%var:potplayer://=%% && call start C:\\PotPlayer\\PotPlayer.exe %%var%%)