ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Issue Commands To a DOS Window (https://www.excelbanter.com/excel-programming/331451-issue-commands-dos-window.html)

Andibevan[_2_]

Issue Commands To a DOS Window
 
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



Tom Ogilvy

Issue Commands To a DOS Window
 
set the default drive an directroy to the location you wish to process

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

--
Regards,
Tom Ogilvy

"Andibevan" wrote in message
...
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





Andibevan[_2_]

Issue Commands To a DOS Window
 
Thanks Tom - in Dos the command is pcli put "c:\Program
Files\PVCS\vm\common\sampledb\archives\checkers\se rver(*.*)" - 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\se rver(*.*)"")

But it all goes red in the vba editor.

"Tom Ogilvy" wrote in message
...
set the default drive an directroy to the location you wish to process

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

--
Regards,
Tom Ogilvy

"Andibevan" wrote in message
...
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






Tom Ogilvy

Issue Commands To a DOS Window
 
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\se rver(*.*)"")

or set it to a variable:

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

Shell(s)

--
Regards,
Tom Ogilvy


"Andibevan" wrote in message
...
Thanks Tom - in Dos the command is pcli put "c:\Program
Files\PVCS\vm\common\sampledb\archives\checkers\se rver(*.*)" - 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\se rver(*.*)"")

But it all goes red in the vba editor.

"Tom Ogilvy" wrote in message
...
set the default drive an directroy to the location you wish to process

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

--
Regards,
Tom Ogilvy

"Andibevan" wrote in

message
...
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








Andibevan[_2_]

Issue Commands To a DOS Window
 
Thanks for explaining why the double quotes are needed - hopefully that
should reduce the chance of me repeating this mistake.

"Tom Ogilvy" wrote in message
...
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\se rver(*.*)"")

or set it to a variable:

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

Shell(s)

--
Regards,
Tom Ogilvy


"Andibevan" wrote in message
...
Thanks Tom - in Dos the command is pcli put "c:\Program
Files\PVCS\vm\common\sampledb\archives\checkers\se rver(*.*)" - 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\se rver(*.*)"")

But it all goes red in the vba editor.

"Tom Ogilvy" wrote in message
...
set the default drive an directroy to the location you wish to process

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

--
Regards,
Tom Ogilvy

"Andibevan" wrote in

message
...
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










All times are GMT +1. The time now is 01:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com