By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,473 Members | 1,278 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,473 IT Pros & Developers. It's quick & easy.

Deploying access using .cmd

P: 40
Hello.

I'm referring to the method used in this post, proposed by Jforbes:
http://bytes.com/topic/access/answer...end-accdb-file

My .cmd reads like this:

Expand|Select|Wrap|Line Numbers
  1. @ECHO OFF
  2. IF NOT EXIST %userprofile%\Documents\DBUser\WKFMS2015.accdb MKDIR %userprofile%\Documents\DBUser
  3. COPY "\\F:\COURT\B. Shem Kalafa\DBase\DBDeployment\WKFMS2015.accdb" %userprofile%\Documents\DBUser\WKFMS2015.accdb /Y
  4. START /I "MSAccess.exe" %userprofile%\Documents\DBUser\WKFMS2015.accdb
When I try to execute it, however, the following message is displayed:
The file name, directory name, or volume label syntax is incorrect.
0 file(s) copied
Could there be something I'm doing wrong, or configuration settings vary for DOS depending on the OS used?
May 26 '15 #1

✓ answered by jforbes

I didn't see it earlier, but on Line 3, the line that performs the copy, has both \\ and F: at the beginning of the path. It should be one or the other, either from a mapped drive or a URL. My guess is you need to remove the beginning \\

Share this Question
Share on Google+
5 Replies


jforbes
Expert 100+
P: 1,107
I didn't see it earlier, but on Line 3, the line that performs the copy, has both \\ and F: at the beginning of the path. It should be one or the other, either from a mapped drive or a URL. My guess is you need to remove the beginning \\
May 26 '15 #2

NeoPa
Expert Mod 15k+
P: 31,768
That's a good point.

I would also suggest that both file name parameters are enclosed in spaces as you don't know if %UserProfile% will result in a value with spaces embedded in it.

So, line #3 would be :
Expand|Select|Wrap|Line Numbers
  1. COPY "F:\COURT\B. Shem Kalafa\DBase\DBDeployment\WKFMS2015.accdb" "%userprofile%\Documents\DBUser\WKFMS2015.accdb" /Y
May 26 '15 #3

jforbes
Expert 100+
P: 1,107
Oh, Good catch NeoPa.
May 26 '15 #4

P: 40
Jforbes, NeoPa, both actually work remarkably well. Thank you so much!
I tested it out on another workstation running Windows 7, and it deployed perfectly. As Google and Outlook do not allow attachment of executable files, I had to send a file path link via email. Apparently, I would need to send directions of using that link on my email too, lol.

Thanks very much!

Wish there were provisions for two best answers, though :-)
May 27 '15 #5

NeoPa
Expert Mod 15k+
P: 31,768
Shem:
Wish there were provisions for two best answers, though :-)
That's very generous of you. I'm afraid I'd have had to reset one in that case anyway. Mine was simply a clarification comment. The fundamental point was caught by JForbes and that's what matters.

Always gratifying to see a happy customer though :-)
May 27 '15 #6

Post your reply

Sign in to post your reply or Sign up for a free account.