Need help Lauching Running an External .vbs file when web page is opened.

  • Thread starter Gordon Cashmore
  • Start date
G

Gordon Cashmore

I am trying to make a web page run an external .vbs file when the page is
opened. Is this possible? If so, can you tell me how?

Basically I am trying to edit a registry entry to set a dword value to open
excel spreadsheets in a separate window instead of the browser window

The code I am running in the script is below. Is there any way to run this
from within a web page, or do this another way than calling a vbscript file?

Thanks for all the help. Gordon Cashmore



const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")

'Writes the registry Entry to add the flag which removes the checkmark from
Browse in Same Window
strKeyPath = "SOFTWARE\classes\excel.sheet.8"
strValueName = "BrowserFlags"
dwValue = 8
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue


'Deletes the registry Entry to remove the checkmark from the Brows in same
window flag
'strKeyPath = "SOFTWARE\classes\excel.sheet.8"
'oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName



Thanks
 
S

Stefan B Rusynko

For security reasons web pages can not run vbs

To open Excel on your machine in Excel (rather than browser) see
http://support.microsoft.com/default.aspx?scid=162059

PS Please don't cross post




| I am trying to make a web page run an external .vbs file when the page is
| opened. Is this possible? If so, can you tell me how?
|
| Basically I am trying to edit a registry entry to set a dword value to open
| excel spreadsheets in a separate window instead of the browser window
|
| The code I am running in the script is below. Is there any way to run this
| from within a web page, or do this another way than calling a vbscript file?
|
| Thanks for all the help. Gordon Cashmore
|
|
|
| const HKEY_LOCAL_MACHINE = &H80000002
| strComputer = "."
| Set StdOut = WScript.StdOut
|
| Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
| strComputer & "\root\default:StdRegProv")
|
| 'Writes the registry Entry to add the flag which removes the checkmark from
| Browse in Same Window
| strKeyPath = "SOFTWARE\classes\excel.sheet.8"
| strValueName = "BrowserFlags"
| dwValue = 8
| oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
|
|
| 'Deletes the registry Entry to remove the checkmark from the Brows in same
| window flag
| 'strKeyPath = "SOFTWARE\classes\excel.sheet.8"
| 'oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName
|
|
|
| Thanks
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top