|
-
Oct 29th, 2009, 10:49 AM
#1
Thread Starter
New Member
How to suppress prompt using XCOPY in Shell
When I am at the command line, if I type the following:
XCOPY C:\ABCDIR\ABC.XLS F:\BACKUP /I
It will copy the file from C: to F: properly without prompting me.
I have this batch file (Q.bat) and the content is:
XCOPY %1 %2 %3
In my VB code, I have the following block:
sfile = "C:\ABCDIR\ABC.XLS"
dfile = "F:\BACKUP"
p ="/I"
Shell ("q.bat " & sfile & " " & dfile & " " & p)
When I run it from VB, it executed the Shell function, but it paused and asked me to answer wether C:\ABCDIR\ABC.XLS is a File(F) or Directory(D).
How can I suppress the prompt in VB?
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|