Link to home
Start Free TrialLog in
Avatar of jeddha
jeddha

asked on

switch to DOS mode

what is the easy way to switch to DOS mode from VB , I want to
copy a file from one directory to floppy disk  as zipfile .
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

In Windows 9x, Me:
Shell "command.com"

In Windows NT, 2000, XP:
Shell "cmd.exe"

Anthony
ASKER CERTIFIED SOLUTION
Avatar of dhavaljariwala
dhavaljariwala

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jeddha
jeddha

ASKER

I want to copy a file from one loaction to another
  shell "command.com /c " & "copy c:\test.txt a:\"
here its not working
That is odd.  It worked fine for me.  Did you put the disk in A drive?

Anthony
Why don't you just use a FileSystemObject to copy the file?  It would probably be a lot easier.

Just add a reference to the Scripting Library in your project and use the following code:


Dim fso
Set fso=CreateObject("Scripting.FileSystemObject")
fso.CopyFile filesource, filedestination, overwrite


Just replace the filesource with your source file and the filedestination with your destination file.  The overwrite is an optional boolean which will force the file to be copied if it set to true (by default it is False).  I think the above code is correct.
Avatar of jeddha

ASKER

I mean DOS mode printing is very fast compared to others