Issue Commands To a DOS Window

A

Andibevan

Hi All,

I have a piece of archiving software that has a command line interface
(operated via a msdos command prompt) and being able to automate some
repeated tasks would have huge benefits.

I will explain how to manually complete the command in hope that someone can
give me some pointers on how I might automate the command:-

1) Open a dos command prompt
2) Navigate to the directory containing the file needed to be archived
3) Run the command from the directory

The problem I am facing is that the command cannot accept the file's
location as a paremeter and you have to select the directory.

Could the shell command be used to complete the above steps? i.e. can you
issue multiple commands to the same command prompt window?

Any help would be really great.

Ta

Andi
 
T

Tom Ogilvy

set the default drive an directroy to the location you wish to process

chdrive "C"
chdir "C:\Myfolder"
shell ---- your command ------
 
A

Andibevan

Thanks Tom - in Dos the command is pcli put "c:\Program
Files\PVCS\vm\common\sampledb\archives\checkers\server(*.*)" - how would
this be activated using the shell command.

I have tried the obvious:- shell (pcli put ""c:\Program
Files\PVCS\vm\common\sampledb\archives\checkers\server(*.*)"")

But it all goes red in the vba editor.

set the default drive an directroy to the location you wish to process

chdrive "C"
chdir "C:\Myfolder"
shell ---- your command ------
 
T

Tom Ogilvy

Shell requires a string argument double-up on double quotes embedded in the
string.

"pcli put ""c:\Program
Files\PVCS\vm\common\sampledb\archives\checkers\server(*.*)"")

or set it to a variable:

s = _
"pcli put ""c:\Program
Files\PVCS\vm\common\sampledb\archives\checkers\server(*.*)"")

Shell(s)
 
A

Andibevan

Thanks for explaining why the double quotes are needed - hopefully that
should reduce the chance of me repeating this mistake.

Shell requires a string argument double-up on double quotes embedded in the
string.

"pcli put ""c:\Program
Files\PVCS\vm\common\sampledb\archives\checkers\server(*.*)"")

or set it to a variable:

s = _
"pcli put ""c:\Program
Files\PVCS\vm\common\sampledb\archives\checkers\server(*.*)"")

Shell(s)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top