Solved

Path to Windows directory in Classic ASP

Posted on 2010-09-17
9
431 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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

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!

Question has a verified solution.

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

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…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

636 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