![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | VbSystemModal type functionality for Read-Host input Hi, Ive got a question regarding "Read-Host" input. In vbscript, you can use vbSystemModal to make your input box always stay on top even if you lose focus (the way task manager does) . Is there any way of achieving the same results with "Read-Host" input? (running from within a .ps1 script) Thanks for any input |
My System Specs![]() |
| | #2 (permalink) |
| | Re: VbSystemModal type functionality for Read-Host input > Sorry, you're trying to duplicate read-host via a GUI? I have the Quote: > latest v2, and although help shows me a "-Gui" switch, it isn't working > on XP SP2. > > This is a cmdlet though. You could overwrite that with a function of > you're liking. I'm sure .NET has a way to handle this, otherwise the > prompting from WSH/VBScript takes a model #, if I remember correctly. > > Marco user input sometimes. When I run the script from PowerGUI Script Editor (instead of from the powershell prompt) the Read-Host pops up what looks like an VBInputBox. I like the idea of writing my own cmdlet that would basically do what I want it to, but... like most of my scripting/programming, I'm self taught. Do you have a site in mind which would have a tutorial or something that closely address my situation? Creating an inputbox that stays on top regardless of focus. Ill do some searching but please post if you have any ideas. six |
My System Specs![]() |
| | #3 (permalink) |
| | Re: VbSystemModal type functionality for Read-Host input On 23 Jan., 17:15, trsix <tr...@xxxxxx> wrote: Quote: Quote: > > Sorry, you're trying to duplicate read-host via a GUI? *I have the > > latest v2, and although help shows me a "-Gui" switch, it isn't working > > on XP SP2. Quote: > > This is a cmdlet though. *You could overwrite that with a function of > > you're liking. *I'm sure .NET has a way to handle this, otherwise the > > prompting from WSH/VBScript takes a model #, if I remember correctly. Quote: > > Marco > Yes, I have a script which basically runs mundane tasks for me but requires > user input sometimes. *When I run the script from PowerGUI Script Editor > (instead of from the powershell prompt) the Read-Host pops up what looks like > an VBInputBox. > > I like the idea of writing my own cmdlet that would basically do what I want > it to, but... like most of my scripting/programming, I'm self taught. > > Do you have a site in mind which would have a tutorial or something that > closely address my situation? > > Creating an inputbox that stays on top regardless of focus. > > Ill do some searching but please post if you have any ideas. > > six have a look at this Technet Scriptcenter "Powershell Tip of the Week" http://www.microsoft.com/technet/scr...pstip0208.mspx Regards BJ |
My System Specs![]() |
| | #4 (permalink) |
| | Re: VbSystemModal type functionality for Read-Host input On 23 Jan., 17:15, trsix <tr...@xxxxxx> wrote: Quote: Quote: > > Sorry, you're trying to duplicate read-host via a GUI? *I have the > > latest v2, and although help shows me a "-Gui" switch, it isn't working > > on XP SP2. Quote: > > This is a cmdlet though. *You could overwrite that with a function of > > you're liking. *I'm sure .NET has a way to handle this, otherwise the > > prompting from WSH/VBScript takes a model #, if I remember correctly. Quote: > > Marco > Yes, I have a script which basically runs mundane tasks for me but requires > user input sometimes. *When I run the script from PowerGUI Script Editor > (instead of from the powershell prompt) the Read-Host pops up what looks like > an VBInputBox. > > I like the idea of writing my own cmdlet that would basically do what I want > it to, but... like most of my scripting/programming, I'm self taught. > > Do you have a site in mind which would have a tutorial or something that > closely address my situation? > > Creating an inputbox that stays on top regardless of focus. > > Ill do some searching but please post if you have any ideas. > > six Namespace in .NET as well http://msdn.microsoft.com/en-us/libr....inputbox.aspx Use this syntax to call the Method within Powershell: [microsoft.VisualBasic.Interaction]::InputBox("Give me input","InputBox") Regards BJ |
My System Specs![]() |
| | #5 (permalink) |
| | Re: VbSystemModal type functionality for Read-Host input On 23 Jan., 23:23, BJ <p...@xxxxxx> wrote: Quote: > On 23 Jan., 17:15, trsix <tr...@xxxxxx> wrote: > > > > > Quote: Quote: > > > Sorry, you're trying to duplicate read-host via a GUI? *I have the > > > latest v2, and although help shows me a "-Gui" switch, it isn't working > > > on XP SP2. Quote: Quote: > > > This is a cmdlet though. *You could overwrite that with a function of > > > you're liking. *I'm sure .NET has a way to handle this, otherwise the > > > prompting from WSH/VBScript takes a model #, if I remember correctly. Quote: Quote: > > > Marco Quote: > > Yes, I have a script which basically runs mundane tasks for me but requires > > user input sometimes. *When I run the script from PowerGUI Script Editor > > (instead of from the powershell prompt) the Read-Host pops up what looks like > > an VBInputBox. Quote: > > I like the idea of writing my own cmdlet that would basically do what Iwant > > it to, but... like most of my scripting/programming, I'm self taught. Quote: > > Do you have a site in mind which would have a tutorial or something that > > closely address my situation? Quote: > > Creating an inputbox that stays on top regardless of focus. Quote: > > Ill do some searching but please post if you have any ideas. Quote: > > six > You can use the static InputBox-Method in the Microsoft.VisualBasic > Namespace in .NET as well > > http://msdn.microsoft.com/en-us/libr...lbasic.interac... > > Use this syntax to call the Method within Powershell: > Load it first: [reflection.assembly]::loadwithpartialname("Microsoft.VisualBasic") Quote: > [microsoft.VisualBasic.Interaction]::InputBox("Give me > input","InputBox") > > Regards > BJ- Zitierten Text ausblenden - > > - Zitierten Text anzeigen - |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| write into an <input type=file> field | VB Script | |||
| Input Type Hidden and Checkbox? | VB Script | |||
| Read-Host issue, won't store to variable when using multiple read-host lines | PowerShell | |||