Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


How do I start  cmd in a specific directory?

Posted on 2003-02-25
Medium Priority
Last Modified: 2010-05-01

I am calling

myproc.Start("cmd.exe", "/c " & Finline)

this calls wscript to run a vb script. But since the script is looking for files that don't exist in the directory that cmd defaults to

C:\Documents and Settings\userx>

the vbscript fails to run correctly. Does anyone have any idea's on how I can make it that the cmd shell starts off in a specific directory when it calls the vbscripts outside of creating a batch file?

I need it to start in



Question by:Amirlit
  • 2
LVL 28

Expert Comment

ID: 8021849
use chdir.

ChDrive "D:"
ChDir "D:\SomeDir"
LVL 28

Accepted Solution

vinnyd79 earned 400 total points
ID: 8021853
ChDir "c:\myapp\myappinfo"

Author Comment

ID: 8021873
Thank you...that did it!


Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

580 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