I have a VBScript which does some calculations and writes the results to a text file. The last thing it does is pops up a message saying ‘Now open C:Text2.txt’ What I would really like it to do is open Notepad itself and display the file on screen. I have Windows XP Annoyances by David Karp (my favourite technical author alongside John Walkenbach!) which gives some code for doing this:
Call Runprogram(“notepad c:/temp2.txt”, False)
.
.
.
Sub RunProgram(filename, Wait)
Set WshShell = WScript.CreateObject(“WScript.Shell”)
RetVal = WshShell.Run(filename, Wait)
End Sub
…but it doesn’t work. It doesn’t crash but nothing happens. I have noticed, however, that after the script has run Task Manager shows Notepad running as a process. Does this mean that all that is required is to make the Notepad execution visible?
TC