Operating System Commands Through VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can I issue a command to execute operating system commands, for example
creating a directory. I would also have to test if the directory exists
before creating it or handle the error afterward. Is that possible from
within an Access module ?
 
rmcompute said:
Can I issue a command to execute operating system commands, for
example creating a directory. I would also have to test if the
directory exists before creating it or handle the error afterward.
Is that possible from within an Access module ?

Test to see if directory exists...

If Dir("PathToFolder", vbDirectory) = "" Then
'Directory does not exist
Else
'Directory does exist
End If


To create a directory...

MkDir "PathToFolder"
 
It worked. Thank you. Is there a way to get a list of all operating system
commands that can be executed ?
 
rmcompute said:
It worked. Thank you. Is there a way to get a list of all operating
system commands that can be executed ?

Those are not "operating system commands". They are standard VBA.
 
Snoop through VISUAL BASIC help under functions. You may also want to
look at the File System Object.
 
Back
Top