TanjimReza Posted December 26, 2019 Share Posted December 26, 2019 Hello, it's me struggling again. Here's what I want to do: I have a textbox named, I want to get the text that user inputed into that box and combine it with a string to run in CMD. I'm getting the text using $code = GUICtrlRead($Name_of_my_Variable) Now I want to run in CMD something like Quote slmgr /ipk $code My expected output is : Link to comment Share on other sites More sharing options...
Nine Posted December 26, 2019 Share Posted December 26, 2019 Try this : $code = GUICtrlRead($Name_of_my_Variable) run (@ComSpec & ' /c slmgr /ipk ' & $code) “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
TanjimReza Posted December 27, 2019 Author Share Posted December 27, 2019 14 hours ago, Nine said: Try this : $code = GUICtrlRead($Name_of_my_Variable) run (@ComSpec & ' /c slmgr /ipk ' & $code) That works! Thanks a lot! Now if I want to hide the windows should the code be this : Quote Quote run (@ComSpec & ' /c slmgr /ipk ' & $code & @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Link to comment Share on other sites More sharing options...
Nine Posted December 27, 2019 Share Posted December 27, 2019 Read the help file, it tells you how to do it. It truly helps reading it run (@ComSpec & ' /c slmgr /ipk ' & $code, "", @SW_HIDE, $STDERR_MERGED) Merry xmas... TanjimReza 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
TanjimReza Posted December 27, 2019 Author Share Posted December 27, 2019 (edited) 39 minutes ago, Nine said: Read the help file, it tells you how to do it. It truly helps reading it run (@ComSpec & ' /c slmgr /ipk ' & $code, "", @SW_HIDE, $STDERR_MERGED) Merry xmas... Merry xmas, you guys are great! Edited December 27, 2019 by TanjimReza Link to comment Share on other sites More sharing options...
TanjimReza Posted December 27, 2019 Author Share Posted December 27, 2019 (edited) Even though I'm using the right code (as I know) the command window still shows. Run(@ScriptDir & "\batchFile.cmd","", @SW_HIDE, $STDERR_MERGED) Is there anything I'm missing? Tried to do the same with ShellExecute. Tried Searching in Documentation. Edited December 27, 2019 by TanjimReza Link to comment Share on other sites More sharing options...
Nine Posted December 27, 2019 Share Posted December 27, 2019 Depends what inside this batch file... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
TanjimReza Posted December 27, 2019 Author Share Posted December 27, 2019 2 minutes ago, Nine said: Depends what inside this batch file... There's echo usage, but even if I remove all 'echo' still DOS window appears. Can't figure what to do. Link to comment Share on other sites More sharing options...
Nine Posted December 27, 2019 Share Posted December 27, 2019 I tried with multiple echo messages and it doesn't show for me. I also can read the messages : #include <Constants.au3> Opt ("MustDeclareVars", 1) Local $pid = Run(@ScriptDir & "\batchFile.cmd","", @SW_HIDE, $STDERR_MERGED) ProcessWaitClose ($pid) MsgBox ($MB_SYSTEMMODAL,"",StdoutRead ($pid)) “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
TanjimReza Posted December 27, 2019 Author Share Posted December 27, 2019 3 hours ago, Nine said: I tried with multiple echo messages and it doesn't show for me. I also can read the messages : #include <Constants.au3> Opt ("MustDeclareVars", 1) Local $pid = Run(@ScriptDir & "\batchFile.cmd","", @SW_HIDE, $STDERR_MERGED) ProcessWaitClose ($pid) MsgBox ($MB_SYSTEMMODAL,"",StdoutRead ($pid)) Don't know why this isn't working for me Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 28, 2019 Moderators Share Posted December 28, 2019 Just tested and it is not showing the cmd window for me either. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! 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