Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing Word, AutoCAD, etc from a webpage

Status
Not open for further replies.

Aciel

Programmer
Aug 1, 2002
1
US
Hi everyone.

I'm working on a PHP Intranet site that is supposed to list the contents of folders on the fileserver. When the user clicks on the name of a document, theoretically it opens in the application its filetype is linked to. Unfortunately, the Win2K machines here seem to have a problem the NT4 machines don't. They prompt the user to download the file, and then it causes trouble when the user is trying to save again. Additionally, IE doesn't recognize certain document types and launch the correct application--for example, AutoCAD.

I thought I could get around this by using VBScript to execute the application instead of simply linking to the document. So I tried three or four different variations of the same three lines:
<script language=&quot;vbscript&quot;>
<!--
set Command = WScript.CreateObject(&quot;WScript.shell&quot;)
cmd = &quot;C:\WINNT\Notepad.exe&quot;
Command.run (cmd)
-->
</script>

Nothing happens. What am I doing wrong?

Thanks in advance,
Aciel
 
Hi,
don't use Wscript.CreateObject just type CreateObject:

<script language=&quot;vbscript&quot;>
<!--
set Command = CreateObject(&quot;WScript.shell&quot;)
cmd = &quot;C:\WINNT\Notepad.exe&quot;
Command.run (cmd)
-->
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top