﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Programming / Powershell  / How to work with CMD prompt and prompt selections / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 23 May 2013 03:13:18 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: How to work with CMD prompt and prompt selections</title><link>http://www.sqlservercentral.com/Forums/Topic1306873-1351-1.aspx</link><description>:) I am thankful you appreciate it. It is all about the journey and learning out realistic limitation in it! Thank you for helping me along that journey!![quote][b]Jeff Moden (5/31/2012)[/b][hr]I sure do appreciate you taking the time for the feedbback here.  As a side bar, what you just said makes me real happy that I walked away from the front end world back in 2002.  ;-)[/quote]</description><pubDate>Thu, 31 May 2012 20:46:22 GMT</pubDate><dc:creator>TeraByteMe</dc:creator></item><item><title>RE: How to work with CMD prompt and prompt selections</title><link>http://www.sqlservercentral.com/Forums/Topic1306873-1351-1.aspx</link><description>I sure do appreciate you taking the time for the feedbback here.  As a side bar, what you just said makes me real happy that I walked away from the front end world back in 2002.  ;-)</description><pubDate>Thu, 31 May 2012 20:30:38 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: How to work with CMD prompt and prompt selections</title><link>http://www.sqlservercentral.com/Forums/Topic1306873-1351-1.aspx</link><description>The only way we could get this to work was to add a flag to the program that bypasses the prompt. Logical because you can't tell a program to do something that it hasn't been written to do, and the only alternative to the prompt seemed to be to send a key stroke to the console once it was there. Not practical at all.</description><pubDate>Thu, 31 May 2012 20:03:49 GMT</pubDate><dc:creator>TeraByteMe</dc:creator></item><item><title>RE: How to work with CMD prompt and prompt selections</title><link>http://www.sqlservercentral.com/Forums/Topic1306873-1351-1.aspx</link><description>Be advised that some of these apps just don't work this way.  They sometimes require the human element to be present at just the right time.</description><pubDate>Tue, 29 May 2012 06:16:13 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: How to work with CMD prompt and prompt selections</title><link>http://www.sqlservercentral.com/Forums/Topic1306873-1351-1.aspx</link><description>I tried every way icould think of to get it to work with get-process but no luck. I will let you know once i confirm.[quote][b]Jeff Moden (5/27/2012)[/b][hr]Thanks for the feedback.  I'd be i[font=][/font]nterested in knowing if it actually works on the one you wanted it to.  Let me know, if yhou get the chance.[/quote]</description><pubDate>Mon, 28 May 2012 17:51:00 GMT</pubDate><dc:creator>TeraByteMe</dc:creator></item><item><title>RE: How to work with CMD prompt and prompt selections</title><link>http://www.sqlservercentral.com/Forums/Topic1306873-1351-1.aspx</link><description>Thanks for the feedback.  I'd be interested in knowing if it actually works on the one you wanted it to.  Let me know, if yhou get the chance.</description><pubDate>Sun, 27 May 2012 21:11:44 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: How to work with CMD prompt and prompt selections</title><link>http://www.sqlservercentral.com/Forums/Topic1306873-1351-1.aspx</link><description>That trick works with the exe that I just created will see if it works with the one I actually have to run it against. Thanks![quote][b]Jeff Moden (5/26/2012)[/b][hr]It sometimes depends on the executable, but I've had good luck with this problem in the past.First, make a text file called Y.txt.  It should contain 1 character.  That character is "Y" without the quotes.  Make sure that when you enter the character to press the [Enter] key after the "Y" in whatever editor you're creating the file in.Then, when you execute the exe, include a redirected input from the Y.txt file.  From a command prompt, it would look like the following...[code="plain"]C:\DB Tools\DBCleaner\DbCleaner.exe &amp;lt; C:\somepath\Y.txt[/code]... where "C:\somepath\" is the actual folder that the Y.txt file lives in.I don't know if "Start-Process -filePath" will handle such redirection, though.[/quote]</description><pubDate>Sun, 27 May 2012 18:11:07 GMT</pubDate><dc:creator>TeraByteMe</dc:creator></item><item><title>RE: How to work with CMD prompt and prompt selections</title><link>http://www.sqlservercentral.com/Forums/Topic1306873-1351-1.aspx</link><description>It sometimes depends on the executable, but I've had good luck with this problem in the past.First, make a text file called Y.txt.  It should contain 1 character.  That character is "Y" without the quotes.  Make sure that when you enter the character to press the [Enter] key after the "Y" in whatever editor you're creating the file in.Then, when you execute the exe, include a redirected input from the Y.txt file.  From a command prompt, it would look like the following...[code="plain"]C:\DB Tools\DBCleaner\DbCleaner.exe &amp;lt; C:\somepath\Y.txt[/code]... where "C:\somepath\" is the actual folder that the Y.txt file lives in.I don't know if "Start-Process -filePath" will handle such redirection, though.</description><pubDate>Sat, 26 May 2012 13:06:13 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: How to work with CMD prompt and prompt selections</title><link>http://www.sqlservercentral.com/Forums/Topic1306873-1351-1.aspx</link><description>This will execute the application but as a result it opens in a cmd window and how to make the default selection of Y (Yes) from the window? Note, the executable doesn't take parameters as input.Start-Process -filePath "C:\DB Tools\DBCleaner\DbCleaner.exe"</description><pubDate>Fri, 25 May 2012 18:16:12 GMT</pubDate><dc:creator>TeraByteMe</dc:creator></item><item><title>How to work with CMD prompt and prompt selections</title><link>http://www.sqlservercentral.com/Forums/Topic1306873-1351-1.aspx</link><description>I have an executable that when ran opens a cmd windows, gives some information, and then prompts for a selection at the prompt as show below:"Would you like to proceed? [Y\N]"I am trying to figure out how best to program the automation of a response of Yes via PowerShell. I have looked at Invoke-Cmd but not getting how I can use this in the way that I need things to work.Any ideas?Thanks!</description><pubDate>Fri, 25 May 2012 18:01:20 GMT</pubDate><dc:creator>TeraByteMe</dc:creator></item></channel></rss>