- Aug 28, 2001
- 52,844
- 1,049
- 126
I have an ASP page with a function (that's written in an include) that grabs output from another server and displays it right on the ASP page using response.write.  The function uses 'psexec' to interact with a command prompt of another server.  PSEXEC is a command-line remoting executable that is capable of bringing output back to your machine.
What I want to do is depending on the output that comes back on the ASP page, I want it to display something to the effect of success or failure.
Right now, it displays "OK: completed successfully" or "ERROR: 0x222 name not found" just fine on the ASP page. I want to display more depending on either of those. If it's the latter, I'd display "failure" on the page.
I am not savvy enough to grab this output from the function and read/react to it using something like inStr(). The output is obviously within the response.write(myfunction()). I've tried referring to the var in the function itself but inStr() doesn't seem to read it correctly and thus doesn't react with either of my conditions - no errors either. Is there some other method of doing this? Am I on the right track here? Can you write up a quick example of how it should be done?
			
			What I want to do is depending on the output that comes back on the ASP page, I want it to display something to the effect of success or failure.
Right now, it displays "OK: completed successfully" or "ERROR: 0x222 name not found" just fine on the ASP page. I want to display more depending on either of those. If it's the latter, I'd display "failure" on the page.
I am not savvy enough to grab this output from the function and read/react to it using something like inStr(). The output is obviously within the response.write(myfunction()). I've tried referring to the var in the function itself but inStr() doesn't seem to read it correctly and thus doesn't react with either of my conditions - no errors either. Is there some other method of doing this? Am I on the right track here? Can you write up a quick example of how it should be done?
 
				
		 
			 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		
 Facebook
Facebook Twitter
Twitter