Re: Need suggestion how to hide ugly black command prompt window



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



.



Relevant Pages

  • Re: Copying files in a certain date range to other locations
    ... Happy Holiday to you to. ... I'll mention a couple extra things about file copying. ... IF your moving files, rather than copying, it's always better to use ... the move command behaves like a copy and delete and copy ...
    (microsoft.public.vb.general.discussion)
  • Setting multiple variables for one "set" command?
    ... various computers on the network. ... The batch file executes without a problem and copies the file over to ... The "file" variable wont have to change at all because we are copying ... like to change after every successful execution of the command. ...
    (microsoft.public.scripting.wsh)
  • Re: Copying files in a certain date range to other locations
    ... Using vb5 I am trying to loop through a folder and select files ... I'll mention a couple extra things about file copying. ... IF your moving files, rather than copying, it's always better to use ... the move command behaves like a copy and delete and copy ...
    (microsoft.public.vb.general.discussion)
  • Re: How to copy whole folders?
    ... and the destination folder to have the same name as a source folder ... I do not want xcopy to supress the error. ... and restart the same xcopy command until all files are copied. ... Windows continue copying files but not quitting copying process as it is ...
    (microsoft.public.windows.file_system)
  • Need suggestion how to hide ugly black command prompt window
    ... There are some scripts we use for transfering data, ... Set oExCmd = oShell.Exec ... ...what to do if copying a file succeded... ... The problem is with this ugly black command prompt that pops up. ...
    (microsoft.public.scripting.vbscript)