Re: echo, not echo

Tech-Archive recommends: Fix windows errors by optimizing your registry



Maybe the Run method?

Dim oShell
Set oShell = WScript.CreateObject ("WSCript.shell")
oShell.run "cmd /k echo %username%"
Set oShell = Nothing

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Todd" wrote:
| Hello people,
|
| I need to use "echo" not wscript.echo in a script. huh? An example
| will probably help:
|
|
| cmd = "echo password| \Program Files\GNU\GnuPG\gpg --batch
| --decrypt-files --passphrase-fd 0 -d " & strIn
|
| Set Sh = CreateObject("WScript.Shell")
| Dim wsx: Set wsx = Sh.Exec(cmd)
| If wsx.ProcessID = 0 And wsx.Status = 1 Then
| Err.Raise vbObjectError,,"WshShell.Exec failed."
| End If
|
| --------------
|
| The "cmd" line runs fine from a prompt. I've searched but cannot find
| an "echo" executable.
|
| Any ideas on how I can use the other echo?
|
| Thanks in advance,
| Todd
|


.



Relevant Pages

  • Re: echo, not echo
    ... Dim oShell ... Set oShell = WScript.CreateObject ... | I need to use "echo" not wscript.echo in a script. ... | The "cmd" line runs fine from a prompt. ...
    (microsoft.public.scripting.vbscript)
  • Re: Minimize all windows
    ... The docs state "Minimizes all of the windows ... > reference to "Microsoft Shell Controls And Automation". ... > Dim oShell As Shell32.Shell ... > Set oShell = New Shell ...
    (microsoft.public.vb.general.discussion)
  • Re: Very Simple script driving me nuts!
    ... >> of shell programming it seems thats biting me in the arse, ... >> to write an utterly simple script to save me some time. ... >> 5 echo ... echo -n "CMD: $*" ...
    (comp.unix.shell)
  • Re: .BAT files in PPC?
    ... >> Why don't you build a link that kicks off CMD with an argument of the ... Notice the CMD.EXE command line argument OUTSIDE the close ... echo The Pushpin files listed below ... .BAT files, and can get quite a lot done with them. ...
    (microsoft.public.pocketpc)
  • Re: mysql scaling questions
    ... serious mysql scaling problems at concurrency> 8 threads ... # cat sysbench.common ... echo "Unknown dbtype"; ... echo $cmd ...
    (freebsd-performance)