PC Review


Reply
Thread Tools Rate Thread

Bat file called from macro addressing network drives - NOT!

 
 
Ron
Guest
Posts: n/a
 
      8th Oct 2009
I have a bat file on a network drive that manipulates data files on a network
drive. However, when I try to run that bat file from a macro, I get:
\\oslo\common\ccstat
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to the windows directory.

The path above is correct, so he recognizes it. I have the drives mapped as
drive letters also.

So how do I trick this thing to run my bat file from a macro? Or can I?

Ron
(BTW, thought I sent this yesterday, so if it shows up twice, I
apologize....I know, I know, if he can't post a question, how can he do VBA?)
 
Reply With Quote
 
 
 
 
Rick Rothstein
Guest
Posts: n/a
 
      8th Oct 2009
What code did you use to try and "run" your BAT file?

--
Rick (MVP - Excel)


"Ron" <(E-Mail Removed)> wrote in message
news:B95151DF-3444-4B28-AA31-(E-Mail Removed)...
>I have a bat file on a network drive that manipulates data files on a
>network
> drive. However, when I try to run that bat file from a macro, I get:
> \\oslo\common\ccstat
> CMD.EXE was started with the above path as the current directory.
> UNC paths are not supported. Defaulting to the windows directory.
>
> The path above is correct, so he recognizes it. I have the drives mapped
> as
> drive letters also.
>
> So how do I trick this thing to run my bat file from a macro? Or can I?
>
> Ron
> (BTW, thought I sent this yesterday, so if it shows up twice, I
> apologize....I know, I know, if he can't post a question, how can he do
> VBA?)


 
Reply With Quote
 
Ron
Guest
Posts: n/a
 
      8th Oct 2009
Call Shell("cmd.exe /c T:\all.bat 10-06-09", 1)

I did it with and without the call statement.

Ron

"Rick Rothstein" wrote:

> What code did you use to try and "run" your BAT file?
>
> --
> Rick (MVP - Excel)
>
>
> "Ron" <(E-Mail Removed)> wrote in message
> news:B95151DF-3444-4B28-AA31-(E-Mail Removed)...
> >I have a bat file on a network drive that manipulates data files on a
> >network
> > drive. However, when I try to run that bat file from a macro, I get:
> > \\oslo\common\ccstat
> > CMD.EXE was started with the above path as the current directory.
> > UNC paths are not supported. Defaulting to the windows directory.
> >
> > The path above is correct, so he recognizes it. I have the drives mapped
> > as
> > drive letters also.
> >
> > So how do I trick this thing to run my bat file from a macro? Or can I?
> >
> > Ron
> > (BTW, thought I sent this yesterday, so if it shows up twice, I
> > apologize....I know, I know, if he can't post a question, how can he do
> > VBA?)

>
>

 
Reply With Quote
 
Ron
Guest
Posts: n/a
 
      9th Oct 2009
Sorry, without the call staement I used X =

"Ron" wrote:

> Call Shell("cmd.exe /c T:\all.bat 10-06-09", 1)
>
> I did it with and without the call statement.
>
> Ron
>
> "Rick Rothstein" wrote:
>
> > What code did you use to try and "run" your BAT file?
> >
> > --
> > Rick (MVP - Excel)
> >
> >
> > "Ron" <(E-Mail Removed)> wrote in message
> > news:B95151DF-3444-4B28-AA31-(E-Mail Removed)...
> > >I have a bat file on a network drive that manipulates data files on a
> > >network
> > > drive. However, when I try to run that bat file from a macro, I get:
> > > \\oslo\common\ccstat
> > > CMD.EXE was started with the above path as the current directory.
> > > UNC paths are not supported. Defaulting to the windows directory.
> > >
> > > The path above is correct, so he recognizes it. I have the drives mapped
> > > as
> > > drive letters also.
> > >
> > > So how do I trick this thing to run my bat file from a macro? Or can I?
> > >
> > > Ron
> > > (BTW, thought I sent this yesterday, so if it shows up twice, I
> > > apologize....I know, I know, if he can't post a question, how can he do
> > > VBA?)

> >
> >

 
Reply With Quote
 
Ron
Guest
Posts: n/a
 
      9th Oct 2009
It has been solved. I needed to change directory in the bat file to the
network drive. Then all works as advertised.

Thanks, anyway guys

"Ron" wrote:

> Sorry, without the call staement I used X =
>
> "Ron" wrote:
>
> > Call Shell("cmd.exe /c T:\all.bat 10-06-09", 1)
> >
> > I did it with and without the call statement.
> >
> > Ron
> >
> > "Rick Rothstein" wrote:
> >
> > > What code did you use to try and "run" your BAT file?
> > >
> > > --
> > > Rick (MVP - Excel)
> > >
> > >
> > > "Ron" <(E-Mail Removed)> wrote in message
> > > news:B95151DF-3444-4B28-AA31-(E-Mail Removed)...
> > > >I have a bat file on a network drive that manipulates data files on a
> > > >network
> > > > drive. However, when I try to run that bat file from a macro, I get:
> > > > \\oslo\common\ccstat
> > > > CMD.EXE was started with the above path as the current directory.
> > > > UNC paths are not supported. Defaulting to the windows directory.
> > > >
> > > > The path above is correct, so he recognizes it. I have the drives mapped
> > > > as
> > > > drive letters also.
> > > >
> > > > So how do I trick this thing to run my bat file from a macro? Or can I?
> > > >
> > > > Ron
> > > > (BTW, thought I sent this yesterday, so if it shows up twice, I
> > > > apologize....I know, I know, if he can't post a question, how can he do
> > > > VBA?)
> > >
> > >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Batch file to show Network drives Bob I Microsoft Windows 2000 CMD Promt 48 5th Jun 2008 08:16 PM
Tarylynn - File Synchronizer - Local Drives, Network Drives, FTP to Server Mel Freeware 0 26th Jun 2005 03:29 PM
I know why they're called CD drives, the staring frogs of Southern Iberia Windows XP General 5 21st Mar 2005 04:30 PM
Batch file to map or disconnect drives on a network John Doue Windows XP General 2 4th Dec 2004 05:04 PM
Addressing the Excel file in which the macro is present. neeraja Microsoft Excel Programming 1 20th Oct 2003 10:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:26 AM.