Now, I have the c# code to execute a vbscript on a remote machine which then returns success or failure.
Now I just can not figure out how to return into c# the result of the script that gets executed.
I am using WMI at present.
Any thought please?
For two days, it has been suggested you look at using the Process class.
If you run your script from within a process, you can redirect the stdout and read it within your program.
The other wapproach is in when you launch your process to redirect standard output to a file. Once your script has completed then read in the content of the file.
I will not google this for you, but there is a lot of information about redirecting output and launching processes from C#. Go read up on it, have a try and come back when you hit a wall. NB - that means yoiu have tried for more than five minutes.
i am using for loop and assigning value to a string.the reference of the memory get cleared after exiting the loop but the memory exits ,so I wanna clear heap memory without using Garbage collection within the loop.
so I wanna clear heap memory without using Garbage collection within the loop
And how would you expect this to work? Strings are managed resources, so are subject to being tidied up by the Garbage Collector. Without using an unmanaged string, I couldn't see an easy way to satisfy this requirement. What could you possibly be doing that you wouldn't want to rely on the GC here?
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.