Solved

Path to Windows directory in Classic ASP

Posted on 2010-09-17
9
428 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

809 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