Dim sSIZE sFILE = "D:\dummy.txt" ' 1Mega Byte sSIZE = 4073741824 DsAlloc sFILE,sSIZE WScript.Quit (0) '----------------------------------------------------------------------- ' 関数名:DsAlloc ' 作成日:2013/09/04 ' 作成者: ' 目 的:DOS コマンドの実行結果を取得します。 ' 戻り値:DOS コマンドの実行結果を String 型で返します。 ' コマンドが正常に実行できた場合はその内容が、エラーが発生した ' 場合はそのエラー内容が返ります。 ' 引 数:sCommand-> 必須/入力用です。実行コマンドを文字列型で渡します。 ' 注 意:実行中はコマンドプロンプト ウィンドウは表示されません。アイコン ' もタスクバーに表示されません。また DOS コマンドは同期実行され ' ます。したがってコマンドの実行が完了するまで制御は戻りません。 '----------------------------------------------------------------------- Function DsAlloc(sFILE,sSIZE) Dim sCommand sCommand = "fsutil file createnew " & sFILE & " " & sSIZE Dim oShell Set oShell = CreateObject ("WSCript.shell") oShell.Run "cmd /K " & sCommand 'oShell.run "cmd /K fsutil file createnew D:\dummy.txt 1073741824" End Function