Link to home
Start Free TrialLog in
Avatar of itbabe
itbabe

asked on

Vbscript : Can FSO.GetBaseName return a foldername ?

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 ?
Avatar of sirbounty
sirbounty
Flag of United States of America image

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 ;)
Avatar of itbabe
itbabe

ASKER

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)
Can you post the solution?
ASKER CERTIFIED SOLUTION
Avatar of itbabe
itbabe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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..