Solved

VBScript problem.

Posted on 2003-11-05
3
183 Views
Last Modified: 2010-05-03
Dear all experts,

I would like to write a .vbs VBScript program to popup the current path. How can I get such result?

TestPath.vbs
-----------------------------
msgbox (App.Path)

It is seem that the App.Path is not work in above program.

Please advise, thank you very much.

superleo
0
Comment
Question by:superleo
3 Comments
 
LVL 50

Accepted Solution

by:
Ryan Chong earned 50 total points
ID: 9691912
See my post at:
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20788448.html

Try use the GetAbsolutePathName method in FSO, example:

test.vbs:

function ShowAbsolutePath(path)
   Dim fso
   Set fso = CreateObject("Scripting.FileSystemObject")  
   ShowAbsolutePath = fso.GetAbsolutePathName(path)  
end function

msgbox ShowAbsolutePath(".")
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 9693567
This will get the file and/or folder path

scriptfile = WScript.ScriptFullName
Msgbox scriptfile

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(scriptfile)
Msgbox f.ParentFolder

Leon
0
 

Author Comment

by:superleo
ID: 10020674
Thanks.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

776 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