Re: Need suggestion how to hide ugly black command prompt window
- From: "Drazen" <delfincek28@xxxxxxxxx>
- Date: 14 Jul 2006 06:33:12 -0700
No that was just an example, we use CMDresutls function for other
things too.
The point is to retrieve the result without black command prompt
window.
Jim wrote:
if all youre doing is copying files, why not just use the file copy methods
available to vbscript??
then you dont have to deal with command windows period
<delfincek28@xxxxxxxxx> wrote in message
news:1152787238.263662.112090@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
There are some scripts we use for transfering data, and they look
something like this:
...
Function CMDResults(cmdline)
Set oShell = CreateObject("WScript.Shell")
Set oExCmd = oShell.Exec(cmdline)
Set oExCmdStdOut = oExCmd.StdOut
Do: WScript.Sleep 10
Do Until oExCmdStdOut.AtEndOfStream
CmdResults = CmdResults & oExCmdStdOut.ReadAll
Loop
Wscript.Sleep 1000
Loop Until (oExCmd.Status <> 0 and oExCmdStdOut.AtEndOfStream)
Logiraj cmdline
Logiraj CMDResults
End Function
...main program starts here...
Do While Not (txtStream.atEndOfStream)
Linija = txtStream.ReadLine
sExec = "cmd /c copy X:\transfer\tra\out\" & Linija & " c:\tran\S" &
p_sifra & "\PRIHVAT /Y" & Chr(13) & Chr(10)
sResult = CMDResults(sExec)
If InStr(1,LCase(sresult),"1 file(s) copied") > 0 Then
...what to do if copying a file succeded...
End If
Loop
Set oFSO = Nothing
...
What this script does it copy file via plain "cmd /c copy" and retrieve
result, so if result incorporates "1 file(s) copied" then copying a
file if considered success, otherwise not.
The problem is with this ugly black command prompt that pops up.
Is there a way i can hide the command prompt window or could I have
done this some other way?
Thank you,
Drazen
.
- References:
- Prev by Date: Internet Explorer 6 and Registy Check
- Next by Date: Re: WshScriptExec mangle stdout characters
- Previous by thread: Re: Need suggestion how to hide ugly black command prompt window
- Next by thread: set wallpaper image from URL
- Index(es):
Relevant Pages
|