|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
JavaScript "WScript.Shell"!
Hi, everyone
I created this JavaScript function in my ASP page: function runReport(repPath) { var rep = new ActiveXObject("WScript.Shell"); rep.Run(repPath, 1, true); } it seems to work fine: for example, notepad.exe, winword.exe... every program is opened correctly. But I have one program, that I need to open my reports, that doesn't work. The error message is "Impossible to find the specified file". I even added in the local system variable "PATH" the .exe file of this program, but anyway it doesn't work. What's the matter? Every help is appreciated. Thanks in advance |
|
#2
|
||||
|
||||
|
if it works for you without any confirm dialog box, it's really really bad: any website can have full control over your computer!
anyways, that error message means you gave invalid path, for example "C:\kgjkdgg.fjd" where file named "kgjkdgg.fjd' does not exist in drive C. note that you must give it full path to the file. |
|
#3
|
||||
|
||||
|
Hi, Shadow Wizard :-)
Quote:
Don't worry, there is confirm dialog box. I just didn't mention it. Quote:
I also tried to give full path (correct of course), but the message error is the same. It's strange. ALL the other programs don't give me any error... |
|
#4
|
||||
|
||||
|
what path did you give?
|
|
#5
|
||||
|
||||
|
I have to open a report that is on the server.
1) "\\serverName\dirName\reportName.rep" it doesn't work, so I thought that this function doesn't accept this kind of path. Just for curious, I tried to open directly the program: 2) "C:\Program Files\Business Objects\BusinessObjects 5.0\BUSOBJ.EXE" but it doesn't work either. The message error is always the same ("can't find the specified file") |
|
#6
|
||||
|
||||
|
if the file is on the server, why not simply put link to that file?? then program will automatically open the file when user click Open...
|
|
#7
|
||||
|
||||
|
It's a long story... :-(
By the way, this function accepts only physical path? Or the syntax "\\serverName\..." should work anyway? |
|
#8
|
||||
|
||||
|
it should work, but it may be permissions problem. I'm not sure though... sorry.
|
|
#9
|
||||
|
||||
|
I also tried this:
var rep = new ActiveXObject("Shell.Application"); rep.shellExecute("C:\Program Files\Business Objects\BusinessObjects 5.0\BUSOBJ.EXE",repPath,"open","1"); But error is: "Authorization denied"... |
|
#10
|
||||
|
||||
|
sorry, I'm out of ideas. try to ask someone who is expert in the network and permissions stuff if this can be permissions problem and if so grant proper permissions to the program or proper user account.
|
|
#11
|
||||
|
||||
|
Hi Shadow Wizard,
I solved the problem and I wanted to let you know: var rep = new ActiveXObject("WScript.Shell"); var str = new String; str = "BUSOBJ.EXE \"" + repPath + "\""; rep.Run(str, 1, true); I had to call the .exe with the file path and name as parameter. Now it works perfectly! Thanks anyway for your support and interest, I appreciate very much :-) |
|
#12
|
||||
|
||||
|
hmm... so that error was from the business program itself. I thought it was about BUSOBJ.EXE file which can't be found.
|
|
#13
|
|
|
|