ABA3D Posted June 24, 2012 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 Link to comment Share on other sites More sharing options...
Ingolme Posted June 24, 2012 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. Link to comment Share on other sites More sharing options...
ABA3D Posted June 25, 2012 Author Share Posted June 25, 2012 Never mind I solved it and yes u can do that in JavaScript. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now