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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using wscript.shell

Status
Not open for further replies.

kurtmo5

Programmer
Jul 16, 2004
18
US
This is what I have but it still opens in a maximized view. It is almost as if the statement is terminated after the file name is opened. This is an external js that I am calling from an asp page.

Sub openDocument(file)
Set oShell = CreateObject("Wscript.Shell")
oShell.Run Chr(34) & file & Chr(34), 2, true
End Sub
 
1) What is a typical value for file
2) Try:
oShell.Run Chr(34) & file & Chr(34), 0, true


[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Change it so that it uses a UNC path instead of a file URL
Sub openDocument(file)
file = Replace(file, "file:", "")
file = Replace(file, "/", "\")
Set oShell = CreateObject("Wscript.Shell")
oShell.Run Chr(34) & file & Chr(34), 2, true
End Sub

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top