Solved

Path to Windows directory in Classic ASP

Posted on 2010-09-17
9
422 Views
Last Modified: 2012-05-10
How do I get the path to the Windows directory in Classic ASP? In VB6 you do it as follows

Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (Byval lpBuffer,Byval nSize) AS String

Function GetWinPath()
Dim strWinPath
strWinPath = Space(255)
GetWindowsDirectory strWinPath, Len(strWinPath)
strWinPath = Trim(strWinPath)
GetWinPath = UCase(Left(strWinPath, Len(strWinPath) - 1)) & "\"
End Function

But in Classic ASP the Declare function is not accepted.
0
Comment
Question by:Frans_Truyens
  • 5
  • 4
9 Comments
 
LVL 3

Expert Comment

by:FreakyEddie
ID: 33700088
Server.MapPath("your-directory")
0
 

Author Comment

by:Frans_Truyens
ID: 33700098
What will that do?
I need the windows diretory, because there I am storing some UDL's.

0
 
LVL 3

Expert Comment

by:FreakyEddie
ID: 33700395
Sorry, then you mean:

Request.ServerVariables("APPL_PHYSICAL_PATH")

Also see ASP 101
0
 
LVL 3

Expert Comment

by:FreakyEddie
ID: 33700415
Wait, that's not true as well.

What do you want to have... your own Windows path or the Windows path of the web-user.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:Frans_Truyens
ID: 33700425
We are coming close. I need the path of Windows eg. c:\Windows. Is this also possible?
0
 

Author Comment

by:Frans_Truyens
ID: 33700430
I want the Windows path of the server.
0
 
LVL 3

Accepted Solution

by:
FreakyEddie earned 500 total points
ID: 33700495
Wouldn't it be easier to make an include where you define the windows folder?

Since it shouldn't change that often...
0
 

Author Comment

by:Frans_Truyens
ID: 33700565
Well, I am fixing some code. And I don't know on which server it is going to be implemented. I suppose that it is c:\Windows. But it can be different also.

Is there a command to retrieve the windows directory? I want to avoid to create a DLL
0
 

Author Closing Comment

by:Frans_Truyens
ID: 33761004
Not really an answer
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now