Re: Need suggestion how to hide ugly black command prompt window
- From: "Jim" <no@xxxxxxxx>
- Date: Thu, 13 Jul 2006 10:21:41 -0400
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
.
- Follow-Ups:
- References:
- Need suggestion how to hide ugly black command prompt window
- From: delfincek28
- Need suggestion how to hide ugly black command prompt window
- Prev by Date: Find/Replace in Excel
- Next by Date: Re: Find/Replace in Excel
- Previous by thread: Re: Need suggestion how to hide ugly black command prompt window
- Next by thread: Re: Need suggestion how to hide ugly black command prompt window
- Index(es):
Relevant Pages
|