Load Program & Print Script 
Author Message
 Load Program & Print Script

The following code will run under Windows95 & Windows98 but I cannot get
it to run under WindowsNT Version 4.00 Service Pack 3.

The following code loads Wordpad and prints the document agline.doc.
Directory and executable paths are correct.

VBS Code:

Set WshShell = Wscript.CreateObject("Wscript.Shell")
WshShell.Run ("%windir%\write agline.doc")

Error Message:

Wscript - Script Execution Error:

Script: D:\JDC1080\agline.vbs
Line: 2
Char: 1
Error: The system cannot find the specified.
Code: 80070002
Source: (null)

Appreciate any help.

Les Campbell



Mon, 03 Dec 2001 03:00:00 GMT  
 Load Program & Print Script
Because it's not in the WinNT folder, it;'s in WinNT\System32

In any case, just remove the %windir%\  since write.exe is in the normal
Windows search path for Win9x and WinNT, you don't need to provide a fully
qualified path to start with.

WshShell.Run "write agline.doc"

--
Michael Harris


| The following code will run under Windows95 & Windows98 but I cannot get
| it to run under WindowsNT Version 4.00 Service Pack 3.
|
| The following code loads Wordpad and prints the document agline.doc.
| Directory and executable paths are correct.
|
| VBS Code:
|
| Set WshShell = Wscript.CreateObject("Wscript.Shell")
| WshShell.Run ("%windir%\write agline.doc")
|
| Error Message:
|
| Wscript - Script Execution Error:
|
| Script: D:\JDC1080\agline.vbs
| Line: 2
| Char: 1
| Error: The system cannot find the specified.
| Code: 80070002
| Source: (null)
|
| Appreciate any help.
|
| Les Campbell



Mon, 03 Dec 2001 03:00:00 GMT  
 Load Program & Print Script
Thanks Michael, I will give that a try. Appreciate the help!

-Les-

Quote:

> Because it's not in the WinNT folder, it;'s in WinNT\System32

> In any case, just remove the %windir%\  since write.exe is in the normal
> Windows search path for Win9x and WinNT, you don't need to provide a fully
> qualified path to start with.

> WshShell.Run "write agline.doc"

> --
> Michael Harris



> | The following code will run under Windows95 & Windows98 but I cannot get
> | it to run under WindowsNT Version 4.00 Service Pack 3.
> |
> | The following code loads Wordpad and prints the document agline.doc.
> | Directory and executable paths are correct.
> |
> | VBS Code:
> |
> | Set WshShell = Wscript.CreateObject("Wscript.Shell")
> | WshShell.Run ("%windir%\write agline.doc")
> |
> | Error Message:
> |
> | Wscript - Script Execution Error:
> |
> | Script: D:\JDC1080\agline.vbs
> | Line: 2
> | Char: 1
> | Error: The system cannot find the specified.
> | Code: 80070002
> | Source: (null)
> |
> | Appreciate any help.
> |
> | Les Campbell




Thu, 06 Dec 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Load a program via HTML

2. Javascript : print() & EI 4 &5

3. Searching for a program to Script Keyboard input to any windows program

4. Clearing browser & re-loading framesets

5. Clearing browser & re-loading framesets

6. Mac&StyleScript&EPS&ClarisWorks&Ill7

7. Postscript programming tools & references

8. Run program & DUN

9. Using HTML & VBScript to run Programs

10. html2ps & Postscript programming

11. Outlook forms and vbscript & outlook programming

12. HPLJ Level II postcript & SysVR4 postio program

 

 
Powered by phpBB® Forum Software