Jump to content

i need help to convert VB script to javascript


ABA3D

Recommended Posts

hi Im writing a small app to my workplace and its using the WMI.I need it to run the notepad or any other app in hidden mode, so I found this script on the net but its in VBS. can anyone help me to convert it to javascript? here is the code:

Const SW_SHOW = 12Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")Set objSWbemServices = objSwbemLocator.ConnectServer(".","root\cimv2")Set oStartup = objSWbemServices.Get("Win32_ProcessStartup")Set oConfig = oStartup.SpawnInstance_oConfig.ShowWindow = SW_SHOWSet objCreateProc = objSWbemServices.Get("Win32_Process")int errReturn = objCreateProc.Create("notepad.exe",Null,oConfig,intProcID)

thank u all for ur help :)

Link to comment
Share on other sites

Javascript doesn't have permissions to open processes on the client's computer. Javascript is only able to manipulate the web page that it is running on.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...