none
VBScript: How create a process in new desktop? RRS feed

  • Question

  • I'm trying create a process in a new desktop using the code below, but happens that the process is executed on default desktop. How solve?

    set wmi = GetObject( "winmgmts:{impersonationLevel=impersonate}!root/cimv2") 
    set proc = wmi.Get("Win32_Process") 
    
    set si = wmi.get("WIN32_ProcessStartup") 
        si.WinstationDesktop =  "winsta0\LLTTestDesktop1" ' "LLTTestDesktop1" is my new desktop
        si.CreateFlags = 16 ' Create_New_Console
        si.ShowWindow  = 1  ' SW_NORMAL 
    
        proc.Create "calc.exe", "C:\Windows\System32", si


    • Moved by Reed KimbleMVP Saturday, May 26, 2018 9:45 PM vb script in vb.net language
    • Moved by Bill_Stewart Friday, July 27, 2018 8:39 PM Abandoned
    Saturday, May 26, 2018 8:34 PM

All replies