My script thus far:
Code:
Name=Inputbox("Enter the PC or Laptop you wish to run UPTIME against:")
Set objShell = CreateObject("WScript.Shell")
objShell.Run "%COMSPEC% /k C:\UPTIME.EXE " & Name & " > c:\uptime.txt"
WScript.Quit
This works. I get a text file with the uptime info in it.
What I would like to do is copy the output in the text file to the clipboard and make it easy to paste into tickets at our help desk.
When I create a variable to hold this in the line:
Code:
uptime = (objShell.Run ("%COMSPEC% /k C:\UPTIME.EXE " & Name))
and then try to output either by MSGBOX or by WSCRIPT.ECHO all I get is a box with a 0 in it.
I was figuring if I could get the output into a variable then I could copy that to the Clipboard and thereby allow it to be pasted in other applications.
I am having no luck so far. Can anyone help me?
Thanks!
Bookmarks