VBScript: Starting another Script, Getting relative Path-Information

I need to start another script from one script.
And I need to know from which path, I starte the first script.

I.e I have a script at C:\Temp and I want to sart another one in C:\Winnt, knowing that I actually started the first one from C:\Temp

Txs for an answer, db
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Richie_SimonettiIT OperationsCommented:
what kind of script are you talking about?, vbscript?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Richie_SimonettiIT OperationsCommented:
To run a vbscript from another script:

dim sh
set sh =createobject("wscript.shell")
sh.run "c:\winnt\otherscript.vbs"
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

db_tigerAuthor Commented:
leonstryker, txs, I already looked in MSDN etc. but didn't find the answer fast enough, that's why I asked thze experts.

RichieSimonettie, that's half of the answer thanks; but now I need to know a variable, with the actually path-variable; best for both scripts. The reason is the following; the first script will take a Ini-File, will then call the second script passing some parameeteres and the starting folder; the seconde script will take the Init-Values, will do some action with them and then take some further files from the location of the first script.
The reason for this kind of strange situation, is that wie have several different configurations and don't want to copy the files (that's) how we solve it for the moment. So, how do I get the Path-Informations?

Richie_SimonettiIT OperationsCommented:
I don't remember the exactly name but .path or ,actualpath should be a property of script that returns what you need. Sorry i haven't VB installed so i cannot test it but, as i told you there is a property, just i don't remember which...
You can run them with:

dim sh
set sh =createobject("wscript.shell")
sh.run "wscript c:\winnt\otherscript.vbs"


dim sh
set sh =createobject("wscript.shell")
sh.run "cscript c:\winnt\otherscript.vbs"
The path information I believe can be determined with App.Path
db_tigerAuthor Commented:
App.Path: Nope.
Other part of answer was already given by Richie_Simonetti.

Path doesn't work.

I think this is it to get the file with the path:
scriptfile = WScript.ScriptFullName
Msgbox scriptfile

To get just the folder:
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(scriptfile)
Msgbox f.ParentFolder
db_tigerAuthor Commented:
There we go, thanks.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.