![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | Write instructions at the command prompt Using Windows XP and Office 2007; I need to code a command line instruction using a VBScript file; I've coded VBScript for other purposes, but I don't know where to start for something like this. Is there a chance someone could post a generic way to access the command prompt and then write some instructions? Thanks! |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Write instructions at the command prompt "xp" <xp@xxxxxx> wrote in message news:59D78EEA-807B-4517-923E-9391275B7CB0@xxxxxx Quote: > Using Windows XP and Office 2007; > > I need to code a command line instruction using a VBScript file; I've > coded > VBScript for other purposes, but I don't know where to start for something > like this. Is there a chance someone could post a generic way to access > the > command prompt and then write some instructions? > > Thanks! - Use the Run method to open a Command Prompt, then use the SendKeys method of the Wscript.Shell object to send your keystrokes. This is easy to program but it is also clumsy and unreliable. - Use the Run method to invoke a batch file of your choice. - Use the Exec method to invoke a batch file of your choice. I suggest you download the help file script56.chm from the Microsoft site to see detailed examples of the various methods. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Write instructions at the command prompt On Jul 16, 9:13*am, "Pegasus [MVP]" <n...@xxxxxx> wrote: Quote: > "xp" <x...@xxxxxx> wrote in message > > news:59D78EEA-807B-4517-923E-9391275B7CB0@xxxxxx > Quote: > > Using Windows XP and Office 2007; Quote: > > I need to code a command line instruction using a VBScript file; I've > > coded > > VBScript for other purposes, but I don't know where to start for something > > like this. Is there a chance someone could post a generic way to access > > the > > command prompt and then write some instructions? Quote: > > Thanks! > I can think of three ways: > - Use the Run method to open a Command Prompt, then use the SendKeys method > of the Wscript.Shell object to send your keystrokes. This is easy to program > but it is also clumsy and unreliable. > - Use the Run method to invoke a batch file of your choice. > - Use the Exec method to invoke a batch file of your choice. > > I suggest you download the help file script56.chm from the Microsoft siteto > see detailed examples of the various methods. 'execute' some instructions. There may or may not be a difference in his/her mind. I didn't want to touch this one because of that distinction, however. Tom Lavedas *********** |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Write instructions at the command prompt "Tom Lavedas" <tglbatch@xxxxxx> wrote in message news:65c3cfa4-f619-4499-8a17-edbd3b48de75@xxxxxx On Jul 16, 9:13 am, "Pegasus [MVP]" <n...@xxxxxx> wrote: Quote: > "xp" <x...@xxxxxx> wrote in message > > news:59D78EEA-807B-4517-923E-9391275B7CB0@xxxxxx > Quote: > > Using Windows XP and Office 2007; Quote: > > I need to code a command line instruction using a VBScript file; I've > > coded > > VBScript for other purposes, but I don't know where to start for > > something > > like this. Is there a chance someone could post a generic way to access > > the > > command prompt and then write some instructions? Quote: > > Thanks! > I can think of three ways: > - Use the Run method to open a Command Prompt, then use the SendKeys > method > of the Wscript.Shell object to send your keystrokes. This is easy to > program > but it is also clumsy and unreliable. > - Use the Run method to invoke a batch file of your choice. > - Use the Exec method to invoke a batch file of your choice. > > I suggest you download the help file script56.chm from the Microsoft site > to > see detailed examples of the various methods. 'execute' some instructions. There may or may not be a difference in his/her mind. I didn't want to touch this one because of that distinction, however. Tom Lavedas *********** ---------- I also don't know what the OP means. Any script run from the command line can echo statements to the console using Wscript.Echo statements. If the script requires an answer before proceeding, an InputBox statement can be used. However, if the OP wants to be able to double click a VBS file and have a command prompt opened with instructions written, the best I can think of is: ======= Dim objShell, strCmd strCmd = "%comspec% /k echo this is my message" Set objShell = CreateObject("Wscript.Shell") objShell.Run strCmd, 1, True ====== The user must enter "exit" to close the command prompt window. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
Make a command prompt run a command as soon as it opens? | General Discussion | |||
| No command prompt | Vista General | |||
| Command prompt "COPY" command not working in brand new Windows Vis | Vista file management | |||
| command prompt help | Vista General | |||
| DVD Command Prompt | Vista installation & setup | |||