出来るのだASP Q&A掲示板(過去LOG)
訪問数 52046
昨日 889
今日 776 【PR】 パソコン入門からIT専門書まで幅広く取り揃えています。セブン-イレブン受取り手数料無料のセブンアンドワイ。 |
![]() ![]() ![]() ![]() ![]() |
[5516] Re:ASPでバッチファイルを起動 |
投稿者:ビギナーズラックさん 2005/12/09 17:40:45 |
> > > 外部ファイル実行の汎用モジュール > > ExecAppWSH("cmd.exe"," /c y:\epoch\System\files\hinmei_sys_new.bat") > > とすると、batファイルが実行されます。 > > > > ビギナーズラック様 お返事本当にありがとうございます! > > 早速下記のように試してみましたが、Functionのところで構文エーらと出てしまいます。 > > 何から何まで申し訳ありませんが、そのあたりの記述の方法も教えていただけませんか。 > > どうかよろしくお願い致します! > > > Function ExecAppWSH(apppath,param) > '******************************************* > '非表示でサーバの外部プログラム実行 > '戻り値 0が正常 > '******************************************* > > On error resume next > > Dim objWshShell > Set objWshShell=Server.CreateObject("WScript.Shell") > > ExecAppWSH("cmd.exe"," /c y:\epoch\System\files\hinmei_sys_new.bat") > > > Set objWshShell = Nothing > > End Function > > おぉっ? モジュールはそのままコピーして変えずに使ってください。 さっきは実行する行の指定を書いたんですが・・・ モジュールをコピーして さらに実際の処理ブロックで以下のようにして使ってください。 if FileExistCheck("y:\epoch\System\files\hinmei_sys_new.bat")=0 then if ExecAppWSH("cmd.exe"," /c y:\epoch\System\files\hinmei_sys_new.bat")=0 then response.write "実行成功" else response.write "実行失敗" end if else response.write "ファイルが存在しない" end if ただ、正直なところfunctionの呼び出しとか記述がわからないのであれば 外部ファイル実行という比較的深いカテゴリに手を出すのは早いと思います。 |
![]() ![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
TreeBBS For ASP V.0.1.3 |