Anyone??
> How can I get my database to execute this DOS substitute command?
>
> subst K: "%appdata%"
>
> Many thanks.
> Kathy
I'm not positive, but I believe you should be able to use the Shell
function, but you need to prefix it with details of the Dos Command
instruction. You may also have to use the Environ function to get the value
of %appdata% for you:
Shell "cmd subst K: " & Chr(34) & Environ("appdata") & Chr(34)
If there's a chance you'll be doing this on an older operating system, you'd
probably be best off using the Environ function to return the value of
%comspec%, rather than hard-coding it to cmd, as I did above.
Shell Environ("comspec") & " subst K: " & Chr(34) & Environ("appdata") &
Chr(34)

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> How can I get my database to execute this DOS substitute command?
>
> subst K: "%appdata%"
>
> Many thanks.
> Kathy
Kathy Webster - 17 Nov 2006 20:15 GMT
Sorry, Doug, no go. :-(
I put your line in the RunCode of a macro and a DOS window opens and stays
open (minimized), and no K: drive has been activated.
btw, this is XP, so older OS is not an issue.
> I'm not positive, but I believe you should be able to use the Shell
> function, but you need to prefix it with details of the Dos Command
[quoted text clipped - 16 lines]
>> Many thanks.
>> Kathy
Douglas J. Steele - 18 Nov 2006 03:19 GMT
Sorry, turns out subst is actually an executable, so you don't need to
invoke the DOS command processor.
Shell "subst K: " & Chr(34) & Environ("appdata") & Chr(34)
is all you need.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> Sorry, Doug, no go. :-(
> I put your line in the RunCode of a macro and a DOS window opens and stays
[quoted text clipped - 21 lines]
>>> Many thanks.
>>> Kathy
Kathy Webster - 18 Nov 2006 17:47 GMT
Once again, Doug, you are my hero! Kudos have been given to you above that
line of code!
> Sorry, turns out subst is actually an executable, so you don't need to
> invoke the DOS command processor.
[quoted text clipped - 28 lines]
>>>> Many thanks.
>>>> Kathy