ABA3D 0 Posted June 24, 2012 Report Share Posted June 24, 2012 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 Quote Link to post Share on other sites
Ingolme 1,020 Posted June 24, 2012 Report Share Posted June 24, 2012 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. Quote Link to post Share on other sites
ABA3D 0 Posted June 25, 2012 Author Report Share Posted June 25, 2012 Never mind I solved it and yes u can do that in JavaScript. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.