Solved

Vbscript : Can  FSO.GetBaseName return a foldername ?

Posted on 2007-03-23
8
1,111 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
  • 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
 

Author Comment

by:itbabe
ID: 18780709
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now