egjeg
asked on
WScript.run output redirect fails
I am trying to call a command from WScript.run and redirect that command's output to a file.
When I call:
errCode = oShell.run("%comspec% /c nslookup " & ipStr,0,True)
everything goes fine and errCode gets a zero. When I try:
errCode = oShell.run("%comspec% /c nslookup " & ipStr & " > " & filePath,0,True)
errCode gets a 1. I have tried setting IIS to use the Administrator account for Anynomous Access thinking that this an issue of write permissions, but this didn't solve the problem. When I enter the command in the run box, everything works as expected.
Please help. Thanks.
When I call:
errCode = oShell.run("%comspec% /c nslookup " & ipStr,0,True)
everything goes fine and errCode gets a zero. When I try:
errCode = oShell.run("%comspec% /c nslookup " & ipStr & " > " & filePath,0,True)
errCode gets a 1. I have tried setting IIS to use the Administrator account for Anynomous Access thinking that this an issue of write permissions, but this didn't solve the problem. When I enter the command in the run box, everything works as expected.
Please help. Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.