WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: Jeff on June 29, 2015, 02:22:30 PM

Title: CMD Prompt Issue
Post by: Jeff on June 29, 2015, 02:22:30 PM
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"))

Title: Re: CMD Prompt Issue
Post by: td on June 29, 2015, 02:59:57 PM
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.

Title: Re: CMD Prompt Issue
Post by: DAG_P6 on July 13, 2015, 01:48:30 PM
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.