アソシエイトを使用
assoc /?
Displays or modifies file extension associations
ASSOC [.ext[=[fileType]]]
.ext Specifies the file extension to associate the file type with
fileType Specifies the file type to associate with the file extension
と ftype
type /?
isplays or modifies file types used in file extension associations
TYPE [fileType[=[openCommandString]]]
fileType Specifies the file type to examine or change
openCommandString Specifies the open command to use when launching files
of this type.
お気に入り
assoc .doc
.doc=OpenOffice.org.Doc
ftype OpenOffice.org.Doc
OpenOffice.org.Doc="C:\Program Files\OpenOffice.org 3\program\\swriter.exe" -o "%1"
.Exec でこれらのプログラムを実行するスクリプトを介して。
アップデート:
コマンドからファイル仕様を切り取ります。
>> sCmd = """C:\Program Files\OpenOffice.org 3\program\\swriter.exe"" -o ""%1"""
>> WScript.Echo sCmd
>> WScript.Echo Split(sCmd, """")(1)
>>
"C:\Program Files\OpenOffice.org 3\program\\swriter.exe" -o "%1"
C:\Program Files\OpenOffice.org 3\program\\swriter.exe
更新 II:
.RegRead を使用して、今週のバージョンのレジストリで情報を見つけようとしないでください。assoc と ftype は、オペレーティング システムが問題に対して提供するツールです。