![]() ![]() ![]() ObjParent.strRes = output(UBound(output)-1) 'array of results, you can: output(0) Join(output) - Usually needed is the lastĬonst WshRunning = 0,WshFailed = 1:Dim i,name,objShellĭim strCmd, strRes, objWnd, objParent, strSignature, wowError, output, exec Set exec = CreateObject("WScript.Shell").Exec(objParent.strCmd) 'objParent.strRes = CreateObject("WScript.Shell").Exec(objParent.strCmd).StdOut.ReadAll() 'simple solution Set objParent = objWnd.getProperty(("signature")) If IsObject(objWnd.getProperty(("signature"))) Then Exit For ObjShell.Run ("""" & Replace(LCase(WScript.FullName), "wscript", "cscript") & """ //nologo """ & WScript.ScriptFullName & """ ""/signature:" & strSignature & """"), 0, Trueįor Each objWnd In CreateObject("Shell.Application").Windows Call a file with a function and arguments is: function Get-Test() ").putProperty strSignature, Me 'C:\Users\username\Desktop\test me.ps1' Get-Test -stringTest 'Hello World'" Call a file with a function and arguments cmd /c start /min "" powershell -WindowStyle Hidden -ExecutionPolicy Bypass -Command ". 'C:\Users\username\Desktop\test me.ps1' -Arg1 'Hello' -Arg2 'World'"ps1' -Arg1 'Hello' -Arg2 ' World'" Call a file with arguments cmd /c start /min "" powershell -WindowStyle Hidden -ExecutionPolicy Bypass -Command ". ![]() Call a file cmd /c start /min "" powershell -WindowStyle Hidden -ExecutionPolicy Bypass -File "C:\Users\username\Desktop\test.ps1"Ģ. Your machine or setup may differ but it works well for me. I've never seen a window flash when calling it via cmd /c start /min "". The answer with -WindowStyle Hidden is great but the windows will still flash. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |