n9mfk9 | 2 Sep 2011 16:15
Picon
Favicon

path ?

hi all 
were this line reads dir can i put the path there like c:\test\test 
/f "tokens=* delims= " %%a in ('dir /b/a:A NOAA*.txt
thanks

------------------------------------

To Post a message, send it to:   batchworld@...

To Unsubscribe, send a blank message to:
batchworld-unsubscribe@...! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/batchworld/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/batchworld/join
    (Yahoo! ID required)

<*> To change settings via email:
    batchworld-digest@... 
    batchworld-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    batchworld-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
(Continue reading)

foxidrive | 2 Sep 2011 16:34

Re: path ?

On 3/09/2011 00:15, n9mfk9 wrote:
> hi all
> were this line reads dir can i put the path there like c:\test\test
> /f "tokens=* delims= " %%a in ('dir /b/a:A NOAA*.txt
> thanks

This puts the current directory in there, but it's just the same as echo %cd%

 <at> echo off
for /f "delims=" %%a in ("%cd%") do echo %%a

What do you need to do?

Maybe this is what you mean?

 <at> echo off
for /f "delims=" %%a in ('dir "c:\test\test\*.txt" /b /a-d') do echo %%a

------------------------------------

To Post a message, send it to:   batchworld@...

To Unsubscribe, send a blank message to:
batchworld-unsubscribe@...! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/batchworld/

<*> Your email settings:
    Individual Email | Traditional
(Continue reading)

n9mfk9 | 3 Sep 2011 04:43
Picon
Favicon

Re: path ?

hi procyon50 ,
the way it works with  /f "tokens=* delims= " %%a in ('dir /b/a:A NOAA*.txt
is i have to run it in the c:\test\test were the txt file is but i went to run the bat form c:\
so how do i change that line so it knows the file it look for is in c:\test\test\
beau 

--- In batchworld@..., foxidrive <foxidrive <at> ...> wrote:
>
> On 3/09/2011 00:15, n9mfk9 wrote:
> > hi all
> > were this line reads dir can i put the path there like c:\test\test
> > /f "tokens=* delims= " %%a in ('dir /b/a:A NOAA*.txt
> > thanks
> 
> 
> 
> This puts the current directory in there, but it's just the same as echo %cd%
> 
>  <at> echo off
> for /f "delims=" %%a in ("%cd%") do echo %%a
> 
> 
> 
> What do you need to do?
> 
> Maybe this is what you mean?
> 
> 
>  <at> echo off
> for /f "delims=" %%a in ('dir "c:\test\test\*.txt" /b /a-d') do echo %%a
(Continue reading)

foxidrive | 3 Sep 2011 08:29

Re: path ?

On 3/09/2011 12:43, n9mfk9 wrote:
> hi procyon50 ,
> the way it works with  /f "tokens=* delims= " %%a in ('dir /b/a:A NOAA*.txt
> is i have to run it in the c:\test\test were the txt file is but i went to run the bat form c:\
> so how do i change that line so it knows the file it look for is in c:\test\test\
> beau
>
> --- In batchworld@..., foxidrive<foxidrive <at> ...>  wrote:
>>
>> On 3/09/2011 00:15, n9mfk9 wrote:
>>> hi all
>>> were this line reads dir can i put the path there like c:\test\test
>>> /f "tokens=* delims= " %%a in ('dir /b/a:A NOAA*.txt
>>> thanks
>>
>>
>>
>> This puts the current directory in there, but it's just the same as echo %cd%
>>
>>  <at> echo off
>> for /f "delims=" %%a in ("%cd%") do echo %%a
>>
>>
>>
>> What do you need to do?
>>
>> Maybe this is what you mean?
>>
>>
>>  <at> echo off
(Continue reading)

n9mfk9 | 3 Sep 2011 17:20
Picon
Favicon

Re: path ?


with for /f "tokens=* delims= " %%a in ('dir  "c:\cumulus\Reports\NOAA*.txt" /b/a:A') do echo put %%~a >> temp.ftp
i got file not found 
--- In batchworld@..., foxidrive <foxidrive <at> ...> wrote:
>
> On 3/09/2011 12:43, n9mfk9 wrote:
> > hi procyon50 ,
> > the way it works with  /f "tokens=* delims= " %%a in ('dir /b/a:A NOAA*.txt
> > is i have to run it in the c:\test\test were the txt file is but i went to run the bat form c:\
> > so how do i change that line so it knows the file it look for is in c:\test\test\
> > beau
> >
> > --- In batchworld@..., foxidrive<foxidrive <at> >  wrote:
> >>
> >> On 3/09/2011 00:15, n9mfk9 wrote:
> >>> hi all
> >>> were this line reads dir can i put the path there like c:\test\test
> >>> /f "tokens=* delims= " %%a in ('dir /b/a:A NOAA*.txt
> >>> thanks
> >>
> >>
> >>
> >> This puts the current directory in there, but it's just the same as echo %cd%
> >>
> >>  <at> echo off
> >> for /f "delims=" %%a in ("%cd%") do echo %%a
> >>
> >>
> >>
> >> What do you need to do?
(Continue reading)

foxidrive | 3 Sep 2011 17:40

Re: Re: path ?

Hmmmm... That is not the code I provided.

Your issue is probably that they don't have the archive attribute set, if the files exist.

On 4/09/2011 01:20, n9mfk9 wrote:
>
> with for /f "tokens=* delims= " %%a in ('dir  "c:\cumulus\Reports\NOAA*.txt" /b/a:A') do echo put %%~a>>  temp.ftp
> i got file not found
> --- In batchworld@..., foxidrive<foxidrive <at> ...>  wrote:
>>
>> On 3/09/2011 12:43, n9mfk9 wrote:
>>> hi procyon50 ,
>>> the way it works with  /f "tokens=* delims= " %%a in ('dir /b/a:A NOAA*.txt
>>> is i have to run it in the c:\test\test were the txt file is but i went to run the bat form c:\
>>> so how do i change that line so it knows the file it look for is in c:\test\test\
>>> beau
>>>
>>> --- In batchworld@..., foxidrive<foxidrive <at> >   wrote:
>>>>
>>>> On 3/09/2011 00:15, n9mfk9 wrote:
>>>>> hi all
>>>>> were this line reads dir can i put the path there like c:\test\test
>>>>> /f "tokens=* delims= " %%a in ('dir /b/a:A NOAA*.txt
>>>>> thanks
>>>>
>>>>
>>>>
>>>> This puts the current directory in there, but it's just the same as echo %cd%
>>>>
>>>>  <at> echo off
(Continue reading)

Theodorik OBroin | 3 Sep 2011 17:54
Picon

Re: Re: path ?

What do you get if you just type:

dir c:\cumulus\reports\NOAA*.txt

and also:

attrib c:\cumulus\reports\NOAA*.txt

?
(Sounds like you may not have the archive bit set on those files).

On 3 September 2011 17:20, n9mfk9 <n9mfk@...> wrote:

> **
>
>
>
> with for /f "tokens=* delims= " %%a in ('dir "c:\cumulus\Reports\NOAA*.txt"
> /b/a:A') do echo put %%~a >> temp.ftp
> i got file not found
> --- In batchworld@..., foxidrive <foxidrive <at> ...> wrote:
> >
> > On 3/09/2011 12:43, n9mfk9 wrote:
> > > hi procyon50 ,
> > > the way it works with /f "tokens=* delims= " %%a in ('dir /b/a:A
> NOAA*.txt
> > > is i have to run it in the c:\t
>

> est\test were the txt file is but i went to run the bat form c:\
(Continue reading)

n9mfk9 | 3 Sep 2011 21:08
Picon
Favicon

Re: path ?

Here is the hole script 

 <at> echo off
echo open yourwebsite.com > temp.ftp
echo yourFtpUserName >> temp.ftp
echo yourFtpPassword >> temp.ftp
echo cd yourWebPath/NOAA-reports >> temp.ftp
for /f "tokens=* delims= " %%a in ('dir /b/a:A NOAA*.txt') do echo put %%~a >> temp.ftp
ftps -a -s:temp.ftp
del temp.ftp
attrib -R NOAA*.txt

if i run this from were the txt file are it ok
i went to change it so it will run from c: an be able to find the file in c:\test\test  

------------------------------------

To Post a message, send it to:   batchworld@...

To Unsubscribe, send a blank message to:
batchworld-unsubscribe@...! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/batchworld/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/batchworld/join
(Continue reading)

foxidrive | 3 Sep 2011 21:21

Re: Re: path ?

On 4/09/2011 05:08, n9mfk9 wrote:
> Here is the hole script
>
>  <at> echo off

pushd "c:\test\test"

> echo open yourwebsite.com>  temp.ftp
> echo yourFtpUserName>>  temp.ftp
> echo yourFtpPassword>>  temp.ftp
> echo cd yourWebPath/NOAA-reports>>  temp.ftp
> for /f "tokens=* delims= " %%a in ('dir /b/a:A NOAA*.txt') do echo put %%~a>>  temp.ftp
> ftps -a -s:temp.ftp
> del temp.ftp
> attrib -R NOAA*.txt

popd

> if i run this from were the txt file are it ok
> i went to change it so it will run from c: an be able to find the file in c:\test\test

Add the two lines above - that is one way to set the source folder.

------------------------------------

To Post a message, send it to:   batchworld@...

To Unsubscribe, send a blank message to:
batchworld-unsubscribe@...! Groups Links

(Continue reading)

Theodorik OBroin | 3 Sep 2011 23:01
Picon

Re: Re: path ?

  Cheers Foxi ;o)
  Was going to say something similar

On 3 September 2011 21:21, foxidrive <foxidrive@...> wrote:

> **
>
>
> On 4/09/2011 05:08, n9mfk9 wrote:
> > Here is the hole script
> >
> >  <at> echo off
>
> pushd "c:\test\test"
>
>
> > echo open yourwebsite.com> temp.ftp
> > echo yourFtpUserName>> temp.ftp
> > echo yourFtpPassword>> temp.ftp
> > echo cd yourWebPath/NOAA-reports>> temp.ftp
> > for /f "tokens=* delims= " %%a in ('dir /b/a:A NOAA*.txt') do echo put
> %%~a>> temp.ftp
> > ftps -a -s:temp.ftp
> > del temp.ftp
> > attrib -R NOAA*.txt
>
> popd
>
>
> > if i run this from were the txt file are it ok
(Continue reading)


Gmane