카테고리 없음

[iis-7] 명령 줄에서 asp 스크립트 실행

필살기쓰세요 2021. 2. 1. 21:32

클래식 ASP 파일이 이미 어딘가의 웹 서버에서 실행 중이고이를 실행하기 위해 호출하려는 경우 다음 코드를 사용하여 .VBS 파일을 만들 수 있습니다.

url="http://foo.com/bar"
Set WshShell = WScript.CreateObject("WScript.Shell")
Set http = CreateObject("Microsoft.XmlHttp")
http.open "GET", URL, FALSE
http.send ""

Windows 작업 스케줄러로 실행하려면 .VBS 파일을 호출하는 단일 행 .CMD 파일을 만듭니다. 예 :

cd \directory-containing-foobar-script
cscript foobar.vbs

도움이 되었기를 바랍니다

-------------------

일반적으로 .asp 파일 php -r <php code>은 PHP에서 와 같이 명령 줄에서 실행할 수 없지만 매개 변수를 사용하여 명령 줄에서 IIS 서버를 시작한 다음 다음과 같은 코드를 실행하는 것입니다.

start /B "C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0\WebDev.WebServer.EXE" /port:9090 /path:"D:\project\MYPROJECT" /vpath:"/MYPROJECT"

// and then start the url
start "http://localhost:9090/MYPROJECT/"


출처
https://stackoverflow.com/questions/39920061