Re: Simple Shell Commands
From: Tom Ogilvy (twogilvy_at_msn.com)
Date: 06/08/04
- Next message: Bob Phillips: "Re: Spinbutton help required"
- Previous message: Bob Phillips: "Re: Alternatives to VBA in Excel"
- In reply to: cogent: "Re: Simple Shell Commands"
- Next in thread: cogent: "Re: Simple Shell Commands"
- Reply: cogent: "Re: Simple Shell Commands"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 8 Jun 2004 15:52:55 -0400
chdrive ActiveWorkbook.path
Chdir Activeworkbook.Path
-- Regards, Tom Ogilvy "cogent" <wweddington@jemmcop.com> wrote in message news:ca53s4$cn6@dispatch.concentric.net... > Hello > > Thank you for your comments. > > Really all I wanted to do was to change to the directory of the active > workbook. This should work: > > Shell "CD /D" & activeworkbook.path > > but it does not. What am I doing wrong? > > W > > "Tom Lavedas" <tlavedas@hotmail.remove.com> wrote in message > news:AD5BAD4A-5906-41D2-BB10-87E38CF882D6@microsoft.com... > > Unles you are doing this exclusively on a Win 95/98/Me equipped machine, > you should not use the Command.com command processor. In fact, the best > thing would be to use the system defined %COMSPEC% environment variable to > locate the command processor in all casses. It keeps things neat and tidy, > regardless of the OS version in use. > > > > More specifically, I believe you need a statement like this ... > > > > Shell "%comspec% /c CD" & activeworkbook.path & _ > > " | copy dest.txt+source.txt dest.txt /b" > > > > This runs the statement ... > > > > CD activeworkbook_path | copy dest.txt+source.txt dest.txt /b > > > > as it would from the command prompt. Note that relative addressing > requires the removal of the absolute drive pathspecs from all of the file > names in the COPY statement. > > > > Tom Lavedas > > =========== > > > > ----- cogent wrote: ----- > > > > Hello > > > > Quick help, please. > > > > In the following command: > > > > Shell "command.com /c" & _ > > "copy c:\dest.txt+c:\source.txt c:\dest.txt /b" > > > > what does the Shell "command.com /c" accomplish? > > > > I am running shell commands that I want to make sure are executed > with the > > active path at the prompt so that the commands behind it are able to > be > > effected on a RELATIVE basis. How? > > > > Like this:? > > > > Shell "command.com " activeworkbook.path & _ > > "copy c:\dest.txt+c:\source.txt c:\dest.txt /b" > > > > The macro is run in a thumb drive where the drive number may vary, > but the > > shell commands must be executed in the directory on the thumb drive. > > > > Please help. > > > > W > > > > > > > >
- Next message: Bob Phillips: "Re: Spinbutton help required"
- Previous message: Bob Phillips: "Re: Alternatives to VBA in Excel"
- In reply to: cogent: "Re: Simple Shell Commands"
- Next in thread: cogent: "Re: Simple Shell Commands"
- Reply: cogent: "Re: Simple Shell Commands"
- Messages sorted by: [ date ] [ thread ]