By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,165 Members | 1,089 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,165 IT Pros & Developers. It's quick & easy.

ActiveXObject("Shell32.Application"). Error Object Expected

P: 3
Hi!! my english is not too good, but i'll try it

I have a javascript code:
Expand|Select|Wrap|Line Numbers
  1.  function executeCommands(inputparms)
  2.    {
  3.   // Instantiate the Shell object and invoke 
  4.    its execute method.
  5.  
  6.     var oShell = new ActiveXObject("Shell32.Application");
  7.  
  8.     var commandtoRun = "C:\\Winnt\\Notepad.exe";
  9.     if (inputparms != "")
  10.      {
  11.       var commandParms = document.Form1.filename.value;
  12.      }
  13.  
  14.  // Invoke the execute method.  
  15.      oShell.ShellExecute(commandtoRun, commandParms, 
  16.       "", "open", "1");
  17.   }
  18.  
But the browser show this message error: Object Expected
Someone can Help me?

Thanks!!
Diego Ruiz
Aug 17 '07 #1
Share this Question
Share on Google+
5 Replies


acoder
Expert Mod 15k+
P: 16,027
Welcome to TSDN!

Please use CODE tags when posting code. Thanks!

Which browser are you using? ActiveX only works in IE. You'll probably also have to confirm that you want the ActiveX control to execute or not.
Aug 17 '07 #2

P: 3
Hi!! thanks for your answers.
I'm using IE browser and I have then ActiveX control to execute

Thanks again

Diego Ruiz


Welcome to TSDN!

Please use CODE tags when posting code. Thanks!

Which browser are you using? ActiveX only works in IE. You'll probably also have to confirm that you want the ActiveX control to execute or not.
Aug 23 '07 #3

acoder
Expert Mod 15k+
P: 16,027
the browser show this message error: Object Expected
Which line causes this error?
Aug 24 '07 #4

P: 3
Which line causes this error?
Hi acoder, the line 6 is raising error:
6. var oShell = new ActiveXObject("Shell32.Application");

Thanks!!

Diego Ruiz
Aug 24 '07 #5

acoder
Expert Mod 15k+
P: 16,027
Hi acoder, the line 6 is raising error:
6. var oShell = new ActiveXObject("Shell32.Application");
The most likely cause is that you haven't enabled ActiveX. Check your settings in your browser.
Aug 24 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.