What if Commandline contains spaces

  • Thread starter Thread starter Prashant Shah
  • Start date Start date
P

Prashant Shah

Res. All,
We can start Microsoft access mdb file with a particular workgroup
file with a specific user from Vb. But it causes errors like "Microsoft
access can not recognize the command line arguments", if the path of the mdb
file or the workgroup file contains spaces such as "C:\Program
files\Skinsoft\Skinsoft.mdb".

What is the correct command-line in this situation,
Thanks in advance,
Yours,
Prashant
 
Res. Sir,
Thanks for the help. But it does not work. Any other solution?

Yours
Prashant
 
Res. Sir,
Thanks for the reply.
Acctually I have made a program foir skin specialists. I want to run it
from a vb exe file into the access program via shell function.
The commandline argument passed in the shell function in vb is something
like this. I have not put the inverted commas yet. The program does not run
with or without them.

x = Shell("C:\Program files\Microsoft Office\Office\Msaccess.exe C:\Program
files \Skinsoft\Skinsoft.mde /User abc /Pwd pqr/Wrkgrp C:\Program
files\Skinsoft\Derma.mdw", vbMaximizedFocus)


Yours
Prashant
 
x = Shell("""C:\Program files\Microsoft Office\Office\Msaccess.exe""
""C:\Program
files \Skinsoft\Skinsoft.mde"" /User abc /Pwd pqr/Wrkgrp ""C:\Program
files\Skinsoft\Derma.mdw""", vbMaximizedFocus)

Anytime you have two double quotes in a row, it gets translated to a single
double quote, so the first argument to Shell is really:

"C:\Program files\Microsoft Office\Office\Msaccess.exe" "C:\Program
files \Skinsoft\Skinsoft.mde" /User abc /Pwd pqr/Wrkgrp "C:\Program
files\Skinsoft\Derma.mdw"
 
Back
Top