HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 8th, 2004, 06:23 AM
aletheia2's Avatar
aletheia2 aletheia2 is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Oct 2003
Posts: 567 aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 Days 6 h 10 m 7 sec
Reputation Power: 9
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

Reply With Quote
  #2  
Old November 8th, 2004, 07:33 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is online now
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,639 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 3 h 4 m 36 sec
Reputation Power: 1902
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.

Reply With Quote
  #3  
Old November 8th, 2004, 08:06 AM
aletheia2's Avatar
aletheia2 aletheia2 is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Oct 2003
Posts: 567 aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 Days 6 h 10 m 7 sec
Reputation Power: 9
Hi, Shadow Wizard :-)

Quote:
Originally Posted by Shadow Wizard
if it works for you without any confirm dialog box, it's really really bad: any website can have full control over your computer!

Don't worry, there is confirm dialog box.
I just didn't mention it.

Quote:
Originally Posted by Shadow Wizard
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.

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...

Reply With Quote
  #4  
Old November 8th, 2004, 08:35 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is online now
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,639 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 3 h 4 m 36 sec
Reputation Power: 1902
what path did you give?

Reply With Quote
  #5  
Old November 8th, 2004, 08:45 AM
aletheia2's Avatar
aletheia2 aletheia2 is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Oct 2003
Posts: 567 aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 Days 6 h 10 m 7 sec
Reputation Power: 9
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")

Reply With Quote
  #6  
Old November 8th, 2004, 09:01 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is online now
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,639 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 3 h 4 m 36 sec
Reputation Power: 1902
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...

Reply With Quote
  #7  
Old November 8th, 2004, 09:13 AM
aletheia2's Avatar
aletheia2 aletheia2 is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Oct 2003
Posts: 567 aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 Days 6 h 10 m 7 sec
Reputation Power: 9
It's a long story... :-(

By the way, this function accepts only physical path? Or the syntax "\\serverName\..." should work anyway?

Reply With Quote
  #8  
Old November 8th, 2004, 09:25 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is online now
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,639 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 3 h 4 m 36 sec
Reputation Power: 1902
it should work, but it may be permissions problem. I'm not sure though... sorry.

Reply With Quote
  #9  
Old November 8th, 2004, 10:28 AM
aletheia2's Avatar
aletheia2 aletheia2 is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Oct 2003
Posts: 567 aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 Days 6 h 10 m 7 sec
Reputation Power: 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"...

Reply With Quote
  #10  
Old November 9th, 2004, 01:24 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is online now
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,639 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 3 h 4 m 36 sec
Reputation Power: 1902
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.

Reply With Quote
  #11  
Old November 9th, 2004, 05:21 AM
aletheia2's Avatar
aletheia2 aletheia2 is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Oct 2003
Posts: 567 aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level)aletheia2 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 Days 6 h 10 m 7 sec
Reputation Power: 9
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 :-)

Reply With Quote
  #12  
Old November 9th, 2004, 08:39 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is online now
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,639 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 3 h 4 m 36 sec
Reputation Power: 1902
hmm... so that error was from the business program itself. I thought it was about BUSOBJ.EXE file which can't be found.

Reply With Quote
  #13  
Old January 26th, 2005, 10:01 AM