명령 앞면에 "CMD /C"추가
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "cmd /c SCHTASKS /QUERY > winning.txt"
문제
다음은 현재 가지고있는 코드입니다.
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "SCHTASKS /QUERY > winning.txt"
내 머리에서 이것은 올바르게 작동하고 오류없이 실행되지만 텍스트 파일은 업데이트되지 않습니다.
텍스트 파일이 이미 작성되었으므로 wscript 변수 생성에 대해 걱정할 필요가 없습니다.
편집하다:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "cmd /c SCHTASKS /QUERY > winning.txt"
데이비드 감사합니다! 나는 그 두 줄을 몇 시간 동안보고 있었다!
해결책
명령 앞면에 "CMD /C"추가
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "cmd /c SCHTASKS /QUERY > winning.txt"