CMD Prompt Issue

Started by Jeff, June 29, 2015, 02:22:30 PM

Previous topic - Next topic

Jeff

I am having trouble getting the following script to work right on Windows 7. It fails to create or push the captured information into the IIS7SiteList.txt. Windows 2012 R2 works fine.

Running "cmd.exe /c C:\Windows\System32\inetsrv\appcmd.exe list site /text:name > C:\Users\e0104088\Desktop\WebSvcCfg 2015 Release\IIS7SiteList.txt" froma cmd prompt works fine.

Any thoughts?

ScriptLocation = DirScript()
WINDIR = Environment("windir")
RunHideWait("cmd.exe",strCat(" /c ", WINDIR, "\System32\inetsrv\appcmd.exe list site /text:name > %ScriptLocation%IIS7SiteList.txt"))

Jeff

td

For debugging purposes use Run instead of RunHideWait and change the '/c' to '/K' so you can see and error messages in the shell command prompt window.  Also remember that you need to quote your output redirection file path+file name when the path contains spaces and there is the 64-bit/32-bit file redirection issue to consider.

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

DAG_P6

Quote from: td on June 29, 2015, 02:59:57 PM
Tthere is the 64-bit/32-bit file redirection issue to consider.

I am unaware of that. Please explain.
David A. Gray
You are more important than any technology.