Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

VBScript + get current directory


  • Please log in to reply

#1
codecraig

codecraig

    Member

  • Member
  • PipPip
  • 61 posts
how can i use vbscript to get the current directory? so if i run test.vbs in C:\data

I want to figure out that I am running in C:\data from test.vbs.

any ideas?

thanks
  • 0

Advertisements


#2
codecraig

codecraig

    Member

  • Topic Starter
  • Member
  • PipPip
  • 61 posts
any ideas?
  • 0

#3
skate_punk_21

skate_punk_21

    Malware Removal Expert

  • Retired Staff
  • 1,049 posts
not so sure about scripting, but for VB6 you've got "CurDir" which returns current working directory. soooo yea....maybe?? lol

Edited by skate_punk_21, 17 August 2005 - 04:24 PM.

  • 0

#4
satih

satih

    New Member

  • Member
  • Pip
  • 2 posts
http://leereid.wordp...tory-or-folder/

man, google for: current directory vbscript
it's basic

if this blog will get deleted, what "leereid" wrote is:

currentDirectory = left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))-(len(WScript.ScriptName)))
WScript.Echo currentDirectory

:)
  • 0

#5
Rosh

Rosh

    New Member

  • Member
  • Pip
  • 1 posts
Hi,
Do this:

Dim sCurPath
sCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")


Gimme a treat for this..

~Rosh
  • 0

#6
satih

satih

    New Member

  • Member
  • Pip
  • 2 posts
Nice one, thanks :)
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP