Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Path to Windows directory in Classic ASP

Posted on 2010-09-17
9
Medium Priority
?
436 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 

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 1000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

885 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