Browse Files on Local Computer in a Terminal Server Session

Folks,

This has been posted previously and I got an answer that worked just fine. Below is the code I'm using. The problem now is that, all of a suddend, it doesn't work anymore as needed. I need the browser to start on the desktop of the local machine. It defaults to the C: drive of the TS:

strStartDir = "\\tsclient\c:\%profiles%\" & Forms![Current User]!FormUserName & "\Desktop"

    strFilter = ahtAddFilterItem(strFilter, _
                        "JPEG Images (*.jpg)", "*.jpg")
    strFilter = ahtAddFilterItem(strFilter, _
                        "GIF images (*.gif)", "*.gif")
    strFilter = ahtAddFilterItem(strFilter, _
                        "PDF files (*.pdf)", "*.pdf")
    strFilter = ahtAddFilterItem(strFilter, _
                        "WORD files (*.doc)", "*.doc")
    strFilter = ahtAddFilterItem(strFilter, _
                        "WORD files (*.docx)", "*.docx")
    strFilter = ahtAddFilterItem(strFilter, _
                        "BMP files (*.bmp)", "*.bmp")
    strFilter = ahtAddFilterItem(strFilter, _
                        "MP4 files (*.mp4)", "*.mp4")
    strFilter = ahtAddFilterItem(strFilter, _
                        "AVI files (*.avi)", "*.avi")
    strFilter = ahtAddFilterItem(strFilter, _
                        "FLASH files (*.flv)", "*.flv")
    strFilter = ahtAddFilterItem(strFilter, _
                        "WMV files (*.wmv)", "*.wmv")
    strFilter = ahtAddFilterItem(strFilter, _
                        "MOV files (*.mov)", "*.mov")
    strFilter = ahtAddFilterItem(strFilter, _
                        "MPG files (*.mpg)", "*.mpg")
    strFilter = ahtAddFilterItem(strFilter, _
                        "REAL MEDIA files (*.rm)", "*.rm")
    strFilter = ahtAddFilterItem(strFilter, _
                        "WAVE files (*.wav)", "*.wav")
    strFilter = ahtAddFilterItem(strFilter, _
                        "MP3 files (*.mp3)", "*.mp3")

    Me.FileToOpen = ahtCommonFileOpenSave(InitialDir:=strStartDir, _
                     Filter:=strFilter, FilterIndex:=1, Flags:=lngFlags, _
                     DialogTitle:="Select File")
                     
    Me.FileType = Right(Me.FileToOpen, 3)
   
    Me.FileDescription.Enabled = True
    Me.FileDescription.SetFocus
LVL 11
EMCITAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I'm not sure how you'd do this, since the call to %profiles% will be resolved on the TS box, and not on the client.

You do have an extra colon ( : ) after the "c" item in the string. You might try removing that to see if it helps.
0
EMCITAuthor Commented:
Doesn't "\\tsclient" reference the user logged on to TS and begin at "C:\" on the client?
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
That's not really what I'm referring to. The token you have here:

"\\tsclient\c:\%profiles%\" & Forms![Current User]!FormUserName & "\Desktop"

is resolved on the machine running the code, which is the RDP session being run. So the Profiles directory may or may not be the same as the actual Profiles directory on the user physical workstation. I would doubt it's the same, given the environment you're working in, but I could be wrong.

Regardless the "c:" (with the colon) doesn't look right, and it is not the same as what I show on my own TS session.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
EMCITAuthor Commented:
Thank you. I removed the colon and it now works as required.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.