[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Vbscript : Can  FSO.GetBaseName return a foldername ?

Posted on 2007-03-23
8
Medium Priority
?
1,150 Views
Last Modified: 2008-02-01
I would like to use the foldername of a folder of which the contextmenu is clicked to be used as a variable in the script that is called by clicking on the item in the contextmenu.  Can this be done with FSO.GetBaseName ?
0
Comment
Question by:itbabe
[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
  • 4
  • 3
8 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 18780671
You won't get the complete path in that manner...

I'm not sure I understand exactly what you're trying to accomplish.
Could you, perhaps, post a code snippet (I'm a visual-guy ;)
0
 

Author Comment

by:itbabe
ID: 18780698
I just wanted the foldername returned when an item was clicked in the contextmenu.

I did it the following way,  it works

Dim arg, fso, shell, Oldfoldername
Set fso = CreateObject("Scripting.FileSystemObject")
Set shell = CreateObject("WScript.Shell")
arg = WScript.Arguments(0)
Oldfoldername=fso.GetBaseName(arg)
0
Technology Partners: 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!

 

Author Comment

by:itbabe
ID: 18780746
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18780909
Can you post the solution?
0
 

Accepted Solution

by:
itbabe earned 0 total points
ID: 18780981
The following has bee, used.
Dim arg, fso, shell, Oldfoldername
Set fso = CreateObject("Scripting.FileSystemObject")
Set shell = CreateObject("WScript.Shell")
arg = WScript.Arguments(0)
Oldfoldername=fso.GetBaseName(arg)

I created a reference in HKEY_CLASSES_ROOT\Folder\shell to start up the script with %1 to be able to send the arguments to the vbs.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18781002
Guess I still don't understand what you're after with this - but to the closing moderator - I have no problems with the closure, and since I'm the only other one involved - no reason for the 4-day wait... :^)
Glad you got it working..
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Script to copy or move mouse-selected collection of files plus targets referenced by shortcuts (.lnk) The purpose of this article is to help illuminate the real challenges and options available (where they may exist) for utilizing simple scriptin…
Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

649 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