Solved

VBScript problem.

Posted on 2003-11-05
3
186 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
[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
3 Comments
 
LVL 51

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Updates not working for MS Windows 7 12 195
Add a task in Outlook from access 11 43
Passing a Text Box name to a Sub 6 102
IF ELSE Statement in Excel Macro VBA 16 87
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

730 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