desktop path (question based on response from yesterday)

  • Thread starter Thread starter Rick
  • Start date Start date
R

Rick

It was suggested yesterday that I could use
"%ALLUSERSPROFILE%\Desktop" as the path to the desktop in
Win 2000 (or use %USERPROFILE%). This makes sense to me,
but for some reason the statement below still does not
work.

Any ideas?

Thanks!

Rick

FileCopy
("C:\BofABusinessCredit\Pipeline\BABC_Pipeline.mdb", "%
ALLUSERSPROFILE%\Desktop\BABC_Pipeline.mdb")
 
In response to the comments below:

Problem: Needing to put a shortcut on the desktop during
setup... something like (as an example... pay no attention
to it being a .mdb file)

Note: using Windows 2000 and VB.net:


FileCopy

1. In regard to Mark's suggestion to try this in cmd...
that does work with the system environment variable in
there.

2. The statement I have below is a just a test... I'm
only trying to set this up so that I can automatically
paste a shortcut to the desktop during setup. I just used
the .mdb in the statement as an example.

3. Anyway, still not sure why this won't work in VB.net.
Any thoughts? Maybe he is right... that the variable
requires some kind of special handling??

Thanks,


Rick

-----Original Message-----
Rick wrote in

That's VB right? I don't know. Do system environment variables
need any special handling?

Try
COPY "C:\BofABusinessCredit\Pipeline\BABC_Pipeline.mdb" "%
ALLUSERSPROFILE%\Desktop"
 
Rick wrote in
In response to the comments below:

Problem: Needing to put a shortcut on the desktop during
setup... something like (as an example... pay no attention
to it being a .mdb file)

Note: using Windows 2000 and VB.net:


FileCopy


1. In regard to Mark's suggestion to try this in cmd...
that does work with the system environment variable in
there.

2. The statement I have below is a just a test... I'm
only trying to set this up so that I can automatically
paste a shortcut to the desktop during setup. I just used
the .mdb in the statement as an example.

3. Anyway, still not sure why this won't work in VB.net.
Any thoughts? Maybe he is right... that the variable
requires some kind of special handling??

No ideas on that. Often a program or scripting language requires you
to say the environment space you want and the name of the variable.
 
Tia wrote in
Function Environ(Expression)
Function Environ$(Expression) As String
Member of VBA.Interaction
Returns the string assigned to an environment variable

so something like:

FileCopy
("C:\BofABusinessCredit\Pipeline\BABC_Pipeline.mdb",
Environ("ALLUSERSPROFILE") & "\Desktop\BABC_Pipeline.mdb")


FWIW I wouldn't rely on that \Desktop\ path existing

Good point. He may need the VB equiv. of IF EXIST in there
somewhere.
 
Back
Top