Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Path to Windows directory in Classic ASP

Posted on 2010-09-17
9
Medium Priority
?
434 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

722 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