Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

setup a schedule task in WIndows XP

45 views
Skip to first unread message

Kent

unread,
Nov 24, 2009, 10:48:42 PM11/24/09
to
Dear all,

I want to write a batch file to set up a scheduled task in Windows XP:

1. copy a file c:\info.db to d:\ every 10 minutes
2. rename the copied file to a series by adding date time to prevent
duplication, info 091125 0810.db , info 091125 0820.db etc
3. hidden the dos windows to avoid disturbance during and after the task
execution

Thanks

Kent


Pegasus [MVP]

unread,
Nov 25, 2009, 2:57:20 AM11/25/09
to

"Kent" <kft...@gmail.com> wrote in message
news:OLeTwIYb...@TK2MSFTNGP06.phx.gbl...

Here are some suggestions:
1. Use this command: copy /y c:\info.db d:\
2. The technique depends on your local format for %date%. What is it?
3. Create a dedicated account called "Scheduler" and use it for the
scheduled task.


Kent

unread,
Nov 25, 2009, 3:27:37 AM11/25/09
to
the date format is dd/mm/yyyy, time is hh:mm


"Pegasus [MVP]" <ne...@microsoft.com> ?�J��s?:%23BowrTa...@TK2MSFTNGP04.phx.gbl...

Pegasus [MVP]

unread,
Nov 25, 2009, 4:31:59 AM11/25/09
to

Is it really dd/mm/yyyy? Isn't there a DOW somewhere?

"Kent" <ke...@micrsoft.com> wrote in message
news:%23B7Moka...@TK2MSFTNGP02.phx.gbl...

Kent

unread,
Nov 25, 2009, 5:03:23 AM11/25/09
to
How can I indentify the local format of %date% please?

"Pegasus [MVP]" <ne...@microsoft.com> ?�J��s?:%23KTrkIb...@TK2MSFTNGP04.phx.gbl...

Pegasus [MVP]

unread,
Nov 25, 2009, 5:33:38 AM11/25/09
to
You must open a Command Prompt:
- Click Start / Run
- Type the three letters cmd
- Click OK
- Type these commands and press the Enter key each time:
echo %date%
echo %time%


"Kent" <ke...@micrsoft.com> wrote in message

news:uR76Habb...@TK2MSFTNGP02.phx.gbl...

Kent

unread,
Nov 25, 2009, 5:59:57 AM11/25/09
to
I see.
The formats are 2009-11-25 Wednesday, 18:59:01.03

"Pegasus [MVP]" <ne...@microsoft.com> ?�J��s?:uvuhCrbb...@TK2MSFTNGP02.phx.gbl...

Pegasus [MVP]

unread,
Nov 25, 2009, 7:00:42 AM11/25/09
to

Fine, that's the information I need. I have to go out now - you can expect a
reply in about 6 hours.


"Kent" <ke...@micrsoft.com> wrote in message

news:OHkh15bb...@TK2MSFTNGP06.phx.gbl...

Pegasus [MVP]

unread,
Nov 25, 2009, 1:14:43 PM11/25/09
to
Here you go:
@echo off
echo Job invoked on %date% at %time:~0,5% 1>> c:\test.txt
for /F "tokens=1" %%a in ('echo %Date:-=%') do set MyDate=%%a
for /F "tokens=1-2" %%a in ('echo %Time::= %') do set MyTime=%%a%%b
echo My Date=%MyDate%, My Time=%MyTime% 1>> c:\test.txt
copy /y c:\info.db "d:\%MyDate% %MyTime%.db" 1>>c:\test.txt 2>>&1

Instructions:
1. Copy & paste the code into your batch file. Do *not* retype it.
2. Start a Command Prompt.
3. Run the batch file.
4. Examine the log file c:\test.txt. Any error messages?
5. See if the .db file got copied to drive d:.
6. Create a scheduled task to run this batch file.
7. Invoke the scheduled task.
8. Repeat points 4 and 5.
9. If all is well, remove every instance of "1>> c:\test.txt" and "2>>&1".
Note also:
- If your %date% / %time% variable suppresses leading 0s (e.g. time=9:59:12
or date=2010-2-9) then your file names will be shortened accordingly. Adding
leading 0s would make the code a little more complex.
- Having a file name of the form "YYMMDD - HHMM.db" does not guarantee you a
unique name. You can get duplicate names between 1 and 2am on the day when
Daylight Saving Time changes back to Standard Time.
- Ask if you wish to know what's behind the code.


"Kent" <ke...@micrsoft.com> wrote in message

news:OHkh15bb...@TK2MSFTNGP06.phx.gbl...

Kent

unread,
Nov 26, 2009, 4:26:43 AM11/26/09
to

Job invoked on 26/11/2009 Thu at 17:20
My Date=26/11/2009, My Time=1720
�t�Χ䤣���w�����|�C
�ƻs�F 0 ���ɮסC

From the above test.txt file found the message "invalid path, 0 file copied"
But I am sure there is a info.db in C:\, and the path D:\ exist.
When I rewrite the last sentence to
copy /y c:\info.db "d:\" 1>>c:\test.txt 2>>&1,
the file info.db can really copied to D:\, but no rename.


Kent


"Pegasus [MVP]" <ne...@microsoft.com> ���g��l��s�D:OMCursfb...@TK2MSFTNGP05.phx.gbl...

Pegasus [MVP]

unread,
Nov 26, 2009, 8:35:43 AM11/26/09
to
I detect a contradiction. In your previous reply you wrote this:
- The formats are 2009-11-25 Wednesday, 18:59:01.03
In the current reply it says:
- Job invoked on 26/11/2009 Thu at 17:20

In other words, you said that you had dashes as delimiters in your date
format. The job you ran reports slashes, not dashes. I do not know what
causes the contradiction but you *must* get rid of the slashes. I also note
that the date format is DD/MM/YYYY, not YYYY-MM-DD DDDD as reported before.
This changes things considerably!


@echo off
echo Job invoked on %date% at %time:~0,5% 1>> c:\test.txt

for /F "tokens=1-3" %%a in ('echo %Date:/= %') do set MyDate=%%c%%b%%a


for /F "tokens=1-2" %%a in ('echo %Time::= %') do set MyTime=%%a%%b
echo My Date=%MyDate%, My Time=%MyTime% 1>> c:\test.txt
copy /y c:\info.db "d:\%MyDate% %MyTime%.db" 1>>c:\test.txt 2>>&1

"Kent" <kft...@gmail.com> wrote in message

news:etfNSqnb...@TK2MSFTNGP04.phx.gbl...

Kent

unread,
Nov 26, 2009, 8:38:22 PM11/26/09
to
Job invoked on 27/11/2009 Fri at 9:13
My Date=20091127, My Time=913
�ƻs�F 1 ���ɮסC

It works now. Thank you Pegasus.
One more thing, the file names would be more consistent if the time format
is 0913 rather than 913.

Kent

"Pegasus [MVP]" <ne...@microsoft.com> ���g��l��s�D:%23CNuc1p...@TK2MSFTNGP04.phx.gbl...

Kent

unread,
Nov 27, 2009, 1:17:51 AM11/27/09
to
I also find that the program can copy a file from c:\ to d:\,
but fails to copy from C:\Program Files\info.db to D:\.
When the space between Program & Files is deleted, it works again.
ANy idea please?

"Pegasus [MVP]" <ne...@microsoft.com> ���g��l��s�D:%23CNuc1p...@TK2MSFTNGP04.phx.gbl...

Pegasus [MVP]

unread,
Nov 27, 2009, 5:50:20 AM11/27/09
to
There are several issues with the current script:
1. I am still puzzled about the date format discrepancies. I suspect that
you chose a date/time format for your logon account that is different from
the inbuilt default format. While this is OK for Windows, it makes the batch
file unreliable.
2. There is the issue with the leading zeros in the date/time strings which
I mentioned in my previous reply.
3. The issue with folder names having embedded spaces is easily solved by
surrounding the whole name with double quotes.
4. I am concerned about the garbage you get at the end of the log file. You
should see a message such as "1 file copied". Did you perhaps select a code
page that refers to a non-English language?

The modified script below resolves points 1..3 above. I numbered the lines
so that you can undo any line wrapping that your newsreader might cause. You
must then remove the line numbers. Do NOT retype the code - just use copy &
paste!

[01] @echo off
[02] set Scr=c:\TempVBS.vbs
[03] set VB=echo^>^>%Scr%
[04] cd 1>nul 2>%Scr%
[05] %VB% WScript.Echo Year(Date) ^& pad(Month(Date)) ^& pad(Day(Date)) ^& "
" ^& pad(Hour(Now)) ^& pad(Minute(Now))
[06] %VB% Function pad (n)
[07] %VB% pad = Right("0" ^& n, 2)
[08] %VB% End Function
[09] for /F "delims=" %%a in ('cscript //nologo %Scr%') do set DateStamp=%%a
[10] del %Scr%
[11]
[12] echo Job invoked on %date% at %time:~0,5% 1>> c:\test.txt
[13] echo DateStamp=%DateStamp% 1>> c:\test.txt
[14] copy /y "c:\info.db" "d:\%DateStamp%.db" 1>>c:\test.txt 2>>&1

"Kent" <kft...@gmail.com> wrote in message

news:u$bfVlybK...@TK2MSFTNGP05.phx.gbl...

Kent

unread,
Nov 29, 2009, 8:26:44 PM11/29/09
to
Pegasus, thank you for your explanation in detail.
The adding of double quotes already solved my problem.
As I am living alone, my PC need no password to log in.
However the windows schedule task needs a log in password to set up the
task.
May this password be skipped?

Kent

"Pegasus [MVP]" <ne...@microsoft.com> ���g��l��s�D:ezgvr90b...@TK2MSFTNGP04.phx.gbl...

Pegasus [MVP]

unread,
Nov 30, 2009, 1:35:24 AM11/30/09
to

Use a dedicated account for your scheduled tasks, as I suggested in my very
first reply.


"Kent" <kft...@gmail.com> wrote in message

news:OWPLZwVc...@TK2MSFTNGP02.phx.gbl...

Kent

unread,
Dec 2, 2009, 9:57:40 PM12/2/09
to

I got it, thanks Pegasus.
Your help me so much

Kent

"Pegasus [MVP]" <ne...@microsoft.com> ���g��l��s�D:u02%23NdYcK...@TK2MSFTNGP06.phx.gbl...

kent

unread,
Dec 24, 2009, 12:07:10 PM12/24/09
to
Dear Pegasus

Actually I am not sure how to create that dedicated account.

Now I have only a log in account without using password. When I create a so
call "Scheduler" account, my PC requires me to select an account to log in
and key in password. But I prefer go straight into windows without log in as
now what I am doing.

Kent

"Pegasus [MVP]" <ne...@microsoft.com> ���g��l��s�D:u02%23NdYcK...@TK2MSFTNGP06.phx.gbl...

Jose

unread,
Dec 24, 2009, 5:26:55 PM12/24/09
to
On Dec 24, 12:07 pm, "kent" <kf...@gmail.com> wrote:
> Dear Pegasus
>
> Actually I am not sure how to create that dedicated account.
>
> Now I have only a log in account without using password. When I create a so
> call "Scheduler" account, my PC requires me to select  an account to log in
> and key in password. But I prefer go straight into windows without log in as
> now what I am doing.
>
> Kent
>
> "Pegasus [MVP]" <n...@microsoft.com> ¼¶¼g©ó¶l¥ó·s»D:u02%23NdYcKHA.1...@TK2MSFTNGP06.phx.gbl...

>
>
>
> > Use a dedicated account for your scheduled tasks, as I suggested in my
> > very first reply.
>
> > "Kent" <kft...@gmail.com> wrote in message
> >news:OWPLZwVc...@TK2MSFTNGP02.phx.gbl...
> >> Pegasus, thank you for your explanation in detail.
> >> The adding of double quotes already solved my problem.
> >> As I am living alone, my PC need no password to log in.
> >> However the windows schedule task needs a log in password to set up the
> >> task.
> >> May this password be skipped?
>
> >> Kent
>
> >> "Pegasus [MVP]" <n...@microsoft.com> ¼¶¼g©ó¶l¥ó·s»D:ezgvr90bKHA.4...@TK2MSFTNGP04.phx.gbl...
> >>>> "Pegasus [MVP]" <n...@microsoft.com> ¼¶¼g©ó¶l¥ó·s»D:%23CNuc1pbKHA.2...@TK2MSFTNGP04.phx.gbl...

> >>>>>I detect a contradiction. In your previous reply you wrote this:
> >>>>> - The formats are 2009-11-25 Wednesday, 18:59:01.03
> >>>>> In the current reply it says:
> >>>>> - Job invoked on 26/11/2009 Thu at 17:20
>
> >>>>> In other words, you said that you had dashes as delimiters in your
> >>>>> date format. The job you ran reports slashes, not dashes. I do not
> >>>>> know what causes the contradiction but you *must* get rid of the
> >>>>> slashes. I also note that the date format is DD/MM/YYYY, not
> >>>>> YYYY-MM-DD DDDD as reported before. This changes things considerably!
> >>>>> @echo off
> >>>>> echo Job invoked on %date% at %time:~0,5% 1>> c:\test.txt
> >>>>> for /F "tokens=1-3" %%a in ('echo %Date:/= %') do set MyDate=%%c%%b%%a
> >>>>> for /F "tokens=1-2" %%a in ('echo %Time::= %') do set MyTime=%%a%%b
> >>>>> echo My Date=%MyDate%, My Time=%MyTime% 1>> c:\test.txt
> >>>>> copy /y c:\info.db "d:\%MyDate% %MyTime%.db" 1>>c:\test.txt 2>>&1
>
> >>>>> "Kent" <kft...@gmail.com> wrote in message
> >>>>>news:etfNSqnb...@TK2MSFTNGP04.phx.gbl...
> >>>>>> Job invoked on 26/11/2009 Thu at 17:20
> >>>>>> My Date=26/11/2009, My Time=1720
> >>>>>> ¨t²Î§ä¤£¨ì«ü©wªº¸ô®|¡C
> >>>>>> ½Æ»s¤F         0 ­ÓÀɮסC

>
> >>>>>> From the above test.txt file found the message "invalid path, 0 file
> >>>>>> copied"
> >>>>>> But I am sure there is a info.db in C:\, and the path D:\ exist.
> >>>>>> When I rewrite the last sentence to
> >>>>>> copy /y c:\info.db "d:\" 1>>c:\test.txt 2>>&1,
> >>>>>> the file info.db can really copied to D:\, but no rename.
>
> >>>>>> Kent
>
> >>>>>> "Pegasus [MVP]" <n...@microsoft.com> ¼¶¼g©ó¶l¥ó·s»D:OMCursfbKHA.5...@TK2MSFTNGP05.phx.gbl...
> >>>>>>> "Kent" <k...@micrsoft.com> wrote in message

> >>>>>>>news:OHkh15bb...@TK2MSFTNGP06.phx.gbl...
> >>>>>>>>I see.
> >>>>>>>> The formats are 2009-11-25 Wednesday, 18:59:01.03
>
> >>>>>>>> "Pegasus [MVP]" <n...@microsoft.com> ?¤J®ø®§·s?:uvuhCrbbKHA.5...@TK2MSFTNGP02.phx.gbl...

> >>>>>>>>> You must open a Command Prompt:
> >>>>>>>>> - Click Start / Run
> >>>>>>>>> - Type the three letters  cmd
> >>>>>>>>> - Click OK
> >>>>>>>>> - Type these commands and press the Enter key each time:
> >>>>>>>>> echo %date%
> >>>>>>>>> echo %time%
>
> >>>>>>>>> "Kent" <k...@micrsoft.com> wrote in message

> >>>>>>>>>news:uR76Habb...@TK2MSFTNGP02.phx.gbl...
> >>>>>>>>>> How can I indentify the local format of %date% please?
>
> >>>>>>>>>> "Pegasus [MVP]" <n...@microsoft.com> ?¤J®ø®§·s?:%23KTrkIbbKHA.4...@TK2MSFTNGP04.phx.gbl...

> >>>>>>>>>>> Is it really dd/mm/yyyy? Isn't there a DOW somewhere?
>
> >>>>>>>>>>> "Kent" <k...@micrsoft.com> wrote in message

> >>>>>>>>>>>news:%23B7Moka...@TK2MSFTNGP02.phx.gbl...
> >>>>>>>>>>>> the date format is dd/mm/yyyy, time is hh:mm
>
> >>>>>>>>>>>> "Pegasus [MVP]" <n...@microsoft.com> ?¤J®ø®§·s?:%23BowrTabKHA.2...@TK2MSFTNGP04.phx.gbl...

>
> >>>>>>>>>>>>> "Kent" <kft...@gmail.com> wrote in message
> >>>>>>>>>>>>>news:OLeTwIYb...@TK2MSFTNGP06.phx.gbl...
> >>>>>>>>>>>>>> Dear all,
>
> >>>>>>>>>>>>>> I want to write a batch file to set up a scheduled task in
> >>>>>>>>>>>>>> Windows XP:
>
> >>>>>>>>>>>>>> 1. copy a file c:\info.db to d:\ every 10 minutes
> >>>>>>>>>>>>>> 2. rename the copied file to a series by adding date time to
> >>>>>>>>>>>>>> prevent duplication, info 091125 0810.db , info 091125
> >>>>>>>>>>>>>> 0820.db etc
> >>>>>>>>>>>>>> 3. hidden the dos windows to avoid disturbance during and
> >>>>>>>>>>>>>> after the task execution
>
> >>>>>>>>>>>>>> Thanks
>
> >>>>>>>>>>>>>> Kent
>
> >>>>>>>>>>>>> Here are some suggestions:
> >>>>>>>>>>>>> 1. Use this command: copy /y c:\info.db d:\
> >>>>>>>>>>>>> 2. The technique depends on your local format for %date%. What
> >>>>>>>>>>>>> is it?
> >>>>>>>>>>>>> 3. Create a dedicated account called "Scheduler" and use it
> >>>>>>>>>>>>> for the scheduled task.

Maybe Pegasus has the day off.

Here is a link describing two methods to login automatically:

http://windowsxp.mvps.org/Autologon.htm

Tweak UI is a popular tool that will let you accomplish your mission
and has some other things in it you may like:

http://www.microsoft.com/windowsxp/downloads/Powertoys/xppowertoys.mspx

kent

unread,
Dec 26, 2009, 9:10:54 AM12/26/09
to
Dear Jose,

Thank you for your hints
I have sloved the problem by using control userpasswords2

Kent

"Jose" <jose...@yahoo.com>
???????:9fb532d4-4401-4e49...@d20g2000yqh.googlegroups.com...


On Dec 24, 12:07 pm, "kent" <kf...@gmail.com> wrote:
> Dear Pegasus
>
> Actually I am not sure how to create that dedicated account.
>
> Now I have only a log in account without using password. When I create a
> so
> call "Scheduler" account, my PC requires me to select an account to log in
> and key in password. But I prefer go straight into windows without log in
> as
> now what I am doing.
>
> Kent
>
> "Pegasus [MVP]" <n...@microsoft.com>

> ���g��l��s�D:u02%23NdYcKHA.1...@TK2MSFTNGP06.phx.gbl...


>
>
>
> > Use a dedicated account for your scheduled tasks, as I suggested in my
> > very first reply.
>
> > "Kent" <kft...@gmail.com> wrote in message
> >news:OWPLZwVc...@TK2MSFTNGP02.phx.gbl...
> >> Pegasus, thank you for your explanation in detail.
> >> The adding of double quotes already solved my problem.
> >> As I am living alone, my PC need no password to log in.
> >> However the windows schedule task needs a log in password to set up the
> >> task.
> >> May this password be skipped?
>
> >> Kent
>
> >> "Pegasus [MVP]" <n...@microsoft.com>

> >> ���g��l��s�D:ezgvr90bKHA.4...@TK2MSFTNGP04.phx.gbl...

> >>>> ���g��l��s�D:%23CNuc1pbKHA.2...@TK2MSFTNGP04.phx.gbl...


> >>>>>I detect a contradiction. In your previous reply you wrote this:
> >>>>> - The formats are 2009-11-25 Wednesday, 18:59:01.03
> >>>>> In the current reply it says:
> >>>>> - Job invoked on 26/11/2009 Thu at 17:20
>
> >>>>> In other words, you said that you had dashes as delimiters in your
> >>>>> date format. The job you ran reports slashes, not dashes. I do not
> >>>>> know what causes the contradiction but you *must* get rid of the
> >>>>> slashes. I also note that the date format is DD/MM/YYYY, not
> >>>>> YYYY-MM-DD DDDD as reported before. This changes things
> >>>>> considerably!
> >>>>> @echo off
> >>>>> echo Job invoked on %date% at %time:~0,5% 1>> c:\test.txt
> >>>>> for /F "tokens=1-3" %%a in ('echo %Date:/= %') do set
> >>>>> MyDate=%%c%%b%%a
> >>>>> for /F "tokens=1-2" %%a in ('echo %Time::= %') do set MyTime=%%a%%b
> >>>>> echo My Date=%MyDate%, My Time=%MyTime% 1>> c:\test.txt
> >>>>> copy /y c:\info.db "d:\%MyDate% %MyTime%.db" 1>>c:\test.txt 2>>&1
>
> >>>>> "Kent" <kft...@gmail.com> wrote in message
> >>>>>news:etfNSqnb...@TK2MSFTNGP04.phx.gbl...
> >>>>>> Job invoked on 26/11/2009 Thu at 17:20
> >>>>>> My Date=26/11/2009, My Time=1720

> >>>>>> �t�Χ䤣���w�����|�C
> >>>>>> �ƻs�F 0 ���ɮסC
>

> >>>>>> From the above test.txt file found the message "invalid path, 0
> >>>>>> file
> >>>>>> copied"
> >>>>>> But I am sure there is a info.db in C:\, and the path D:\ exist.
> >>>>>> When I rewrite the last sentence to
> >>>>>> copy /y c:\info.db "d:\" 1>>c:\test.txt 2>>&1,
> >>>>>> the file info.db can really copied to D:\, but no rename.
>
> >>>>>> Kent
>
> >>>>>> "Pegasus [MVP]" <n...@microsoft.com>

> >>>>>> ���g��l��s�D:OMCursfbKHA.5...@TK2MSFTNGP05.phx.gbl...

> >>>>>>>> ?�J��s?:uvuhCrbbKHA.5...@TK2MSFTNGP02.phx.gbl...


> >>>>>>>>> You must open a Command Prompt:
> >>>>>>>>> - Click Start / Run
> >>>>>>>>> - Type the three letters cmd
> >>>>>>>>> - Click OK
> >>>>>>>>> - Type these commands and press the Enter key each time:
> >>>>>>>>> echo %date%
> >>>>>>>>> echo %time%
>
> >>>>>>>>> "Kent" <k...@micrsoft.com> wrote in message
> >>>>>>>>>news:uR76Habb...@TK2MSFTNGP02.phx.gbl...
> >>>>>>>>>> How can I indentify the local format of %date% please?
>
> >>>>>>>>>> "Pegasus [MVP]" <n...@microsoft.com>

> >>>>>>>>>> ?�J��s?:%23KTrkIbbKHA.4...@TK2MSFTNGP04.phx.gbl...


> >>>>>>>>>>> Is it really dd/mm/yyyy? Isn't there a DOW somewhere?
>
> >>>>>>>>>>> "Kent" <k...@micrsoft.com> wrote in message
> >>>>>>>>>>>news:%23B7Moka...@TK2MSFTNGP02.phx.gbl...
> >>>>>>>>>>>> the date format is dd/mm/yyyy, time is hh:mm
>
> >>>>>>>>>>>> "Pegasus [MVP]" <n...@microsoft.com>

> >>>>>>>>>>>> ?�J��s?:%23BowrTabKHA.2...@TK2MSFTNGP04.phx.gbl...

Jose

unread,
Dec 26, 2009, 11:17:12 AM12/26/09
to
On Dec 26, 9:10 am, "kent" <kf...@gmail.com> wrote:
> Dear Jose,
>
> Thank you for your hints
> I have sloved the problem by using control userpasswords2
>
> Kent
>
> "Jose" <jose_e...@yahoo.com>
> ???????:9fb532d4-4401-4e49-bf23-7334e9f70...@d20g2000yqh.googlegroups.com...

> On Dec 24, 12:07 pm, "kent" <kf...@gmail.com> wrote:
>
>
>
>
>
> > Dear Pegasus
>
> > Actually I am not sure how to create that dedicated account.
>
> > Now I have only a log in account without using password. When I create a
> > so
> > call "Scheduler" account, my PC requires me to select an account to log in
> > and key in password. But I prefer go straight into windows without log in
> > as
> > now what I am doing.
>
> > Kent
>
> > "Pegasus [MVP]" <n...@microsoft.com>
> > ¼¶¼g©ó¶l¥ó·s»D:u02%23NdYcKHA.1...@TK2MSFTNGP06.phx.gbl...

>
> > > Use a dedicated account for your scheduled tasks, as I suggested in my
> > > very first reply.
>
> > > "Kent" <kft...@gmail.com> wrote in message
> > >news:OWPLZwVc...@TK2MSFTNGP02.phx.gbl...
> > >> Pegasus, thank you for your explanation in detail.
> > >> The adding of double quotes already solved my problem.
> > >> As I am living alone, my PC need no password to log in.
> > >> However the windows schedule task needs a log in password to set up the
> > >> task.
> > >> May this password be skipped?
>
> > >> Kent
>
> > >> "Pegasus [MVP]" <n...@microsoft.com>
> > >> ¼¶¼g©ó¶l¥ó·s»D:ezgvr90bKHA.4...@TK2MSFTNGP04.phx.gbl...
> > >>>> ¼¶¼g©ó¶l¥ó·s»D:%23CNuc1pbKHA.2...@TK2MSFTNGP04.phx.gbl...

> > >>>>>I detect a contradiction. In your previous reply you wrote this:
> > >>>>> - The formats are 2009-11-25 Wednesday, 18:59:01.03
> > >>>>> In the current reply it says:
> > >>>>> - Job invoked on 26/11/2009 Thu at 17:20
>
> > >>>>> In other words, you said that you had dashes as delimiters in your
> > >>>>> date format. The job you ran reports slashes, not dashes. I do not
> > >>>>> know what causes the contradiction but you *must* get rid of the
> > >>>>> slashes. I also note that the date format is DD/MM/YYYY, not
> > >>>>> YYYY-MM-DD DDDD as reported before. This changes things
> > >>>>> considerably!
> > >>>>> @echo off
> > >>>>> echo Job invoked on %date% at %time:~0,5% 1>> c:\test.txt
> > >>>>> for /F "tokens=1-3" %%a in ('echo %Date:/= %') do set
> > >>>>> MyDate=%%c%%b%%a
> > >>>>> for /F "tokens=1-2" %%a in ('echo %Time::= %') do set MyTime=%%a%%b
> > >>>>> echo My Date=%MyDate%, My Time=%MyTime% 1>> c:\test.txt
> > >>>>> copy /y c:\info.db "d:\%MyDate% %MyTime%.db" 1>>c:\test.txt 2>>&1
>
> > >>>>> "Kent" <kft...@gmail.com> wrote in message
> > >>>>>news:etfNSqnb...@TK2MSFTNGP04.phx.gbl...
> > >>>>>> Job invoked on 26/11/2009 Thu at 17:20
> > >>>>>> My Date=26/11/2009, My Time=1720
> > >>>>>> ¨t²Î§ä¤£¨ì«ü©wªº¸ô®|¡C
> > >>>>>> ½Æ»s¤F 0 ­ÓÀɮסC
>
> > >>>>>> From the above test.txt file found the message "invalid path, 0
> > >>>>>> file
> > >>>>>> copied"
> > >>>>>> But I am sure there is a info.db in C:\, and the path D:\ exist.
> > >>>>>> When I rewrite the last sentence to
> > >>>>>> copy /y c:\info.db "d:\" 1>>c:\test.txt 2>>&1,
> > >>>>>> the file info.db can really copied to D:\, but no rename.
>
> > >>>>>> Kent
>
> > >>>>>> "Pegasus [MVP]" <n...@microsoft.com>
> > >>>>>> ¼¶¼g©ó¶l¥ó·s»D:OMCursfbKHA.5...@TK2MSFTNGP05.phx.gbl...
> > >>>>>>>> ?¤J®ø®§·s?:uvuhCrbbKHA.5...@TK2MSFTNGP02.phx.gbl...

> > >>>>>>>>> You must open a Command Prompt:
> > >>>>>>>>> - Click Start / Run
> > >>>>>>>>> - Type the three letters cmd
> > >>>>>>>>> - Click OK
> > >>>>>>>>> - Type these commands and press the Enter key each time:
> > >>>>>>>>> echo %date%
> > >>>>>>>>> echo %time%
>
> > >>>>>>>>> "Kent" <k...@micrsoft.com> wrote in message
> > >>>>>>>>>news:uR76Habb...@TK2MSFTNGP02.phx.gbl...
> > >>>>>>>>>> How can I indentify the local format of %date% please?
>
> > >>>>>>>>>> "Pegasus [MVP]" <n...@microsoft.com>
> > >>>>>>>>>> ?¤J®ø®§·s?:%23KTrkIbbKHA.4...@TK2MSFTNGP04.phx.gbl...

> > >>>>>>>>>>> Is it really dd/mm/yyyy? Isn't there a DOW somewhere?
>
> > >>>>>>>>>>> "Kent" <k...@micrsoft.com> wrote in message
> > >>>>>>>>>>>news:%23B7Moka...@TK2MSFTNGP02.phx.gbl...
> > >>>>>>>>>>>> the date format is dd/mm/yyyy, time is hh:mm
>
> > >>>>>>>>>>>> "Pegasus [MVP]" <n...@microsoft.com>
> > >>>>>>>>>>>> ?¤J®ø®§·s?:%23BowrTabKHA.2...@TK2MSFTNGP04.phx.gbl...

Good job.

0 new messages