Re: Executing DOS Commands from Access VBA

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



my guess is that you are not properly handling spaces. for example,
"c:\program files\.." needs to be in quotes. Run the command at the DOS
level, then use it in shell.

an alternative is to create a batch file and use the shell command to run
it..

Bob


"Chaplain Doug" <ChaplainDoug@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DC4233F4-94DE-4929-AE46-E86AD1C6C4D1@xxxxxxxxxxxxxxxx
Access 2003. I know about the Shell command. However, when I try

Shell "Copy C:\Program Files\Grading\Grading_be.mdb C:\Program
Files\Grading\Grading_be_backup.mdb"

I get a message saying "File not found," even though the source file does
exist as specified. However, when I use

Shell "XCopy C:\Program Files\Grading\Grading_be.mdb C:\Program
Files\Grading\Grading_be_backup.mdb"

I do not get an error, but the destination file does not exist in the
specified folder after the operation completes. What am I missing here?
Thanks.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org


.



Relevant Pages

  • Shell Command Doesnt Create TXT file as expected
    ... I am having problems using the shell command to write the output of a dos ... Sub Test ... What is the correct syntax to write a dos command to a file using Shell? ...
    (microsoft.public.vb.general.discussion)
  • Re: VB6 and Shell
    ... Can't tell for sure from your description, but if the shell command ... I'd use VB to call a batch file that calls the command. ... The shell command seems to run the external program asychronously as you ... Is there away to leave the DOS box open to ...
    (microsoft.public.vb.general.discussion)
  • Re: DOS / XP bat file programming question
    ... How do I feed a "y" response to a DOS command that wants to prompt me ... Note that DOS is an operating system, same as Windows XP. ... There is no DOS under Windows, only a Command Prompt. ...
    (microsoft.public.windowsxp.general)
  • Re: Master Boot Record
    ... Is the DOS program relating to the commands which you mentioned in your ... > If you don't know why you'd want to restore or backup a boot sector then don't do it. ... It also contains the partition table. ... The LOCK command enables direct disk access by programs ...
    (microsoft.public.windowsxp.general)
  • Re: newbie: I/O with nasm
    ... A program that starts with "main" and is linked with gcc has the "_start" label in the C startup code, and the stack is slightly different when we get control at "main". ... Dos is *very* different, as you point out. ... Working on up the (Linux) stack, the list of command line argument pointers is terminated with a zero. ...
    (alt.lang.asm)