Re: new script



I don't make the file test.vbs and work fine without "^" caracter. I'm going
to test in w2k3.
Thanks

"Pegasus (MVP)" wrote:

Thanks for the feedback.

The caret character ^ is required when generating test.vbs
file from within the batch file. If you create test.vbs manually
then you must remove the ^ character.


"Alberto Arias" <AlbertoArias@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6BAEBC16-82AB-4C37-A8F7-2E953F826698@xxxxxxxxxxxxxxxx

Hi, thank you very much. The script don's work by the "^" caracter. I've
delete thecaracter and work fine.

I did not know why you call a test.vbs. I understand all now.

I'm really thankfull for your help (and script).

"Pegasus (MVP)" wrote:

Two comments:
1. I suspect that you saved the file as a .vbs file. This won't
work. You must save it as a .bat file.
2. You still have lots of # characters in the script. You must
remove all of them.

If you still have a problem, remember to post your version
of the file.


"Alberto Arias" <AlbertoArias@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3963A5C3-DEF8-4232-B6C4-391DBDB7CE03@xxxxxxxxxxxxxxxx
i use the same script. I only modified the batchfile that you use:

@echo off <==The @ caracter make me one error
setlocal EnableDelayedExpansion

# Declaramos cual es el fichero que sera la variable
set Semaphore=C:\scripts\prueba\Semaphore.txt <== I use your file in
other
path


# echo> c:\test.vbs <=== i'm trying in the same line all and in other
line
the
Set objFSO = CreateObject("Scripting.FileSystemObject") <==object,
actually
is in only one line
#echo>> c:\test.vbs <== same
Set file = objFSO.GetFile("%Semaphore%")
#echo>> c:\test.vbs
wscript.quit (DateDiff("h", file.DateLastModified, Now)^> 6)

if exist "%Semaphore%"
(
cscript //nologo c:\test.vbs
if !ErrorLevel! NEQ 0 goto :eof
del "%Semaphore%"
call batchfile.bat <== to try execution i call batchfile.bat that run
notepad
) else
(
echo. > %Semaphore%
call batchfile2.bat <== to try execution i call batchfile.bat that run
iexplore
)

i call the script test.vbs like in your script. I'm trying in s.o xp
and
in
one server with w2k3 sp2

All files are in the same folder c:\scripts\prueba.

Thank you very much for your patience and time. i know i'm very clumsy
with
scripting


"Pegasus (MVP)" wrote:

You have to post YOUR version of the file, without # characters,
so that I can see what you did.


"Alberto Arias" <AlbertoArias@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
news:F7F8DD4C-2900-466D-8F46-C4C4A2F3A69D@xxxxxxxxxxxxxxxx
Thank you very much for your time. Unfortunately your script don't
work
in
my
enviroment. I received error in execution.
I remove all "#" tag. When i execute this i receive no valid carater
for
"@". When i delete this, i found error Expected statement in line 3.

i'm trying to declare tehe variable, but i have too much problems.
In
your
enviroment work fine???


"Pegasus (MVP)" wrote:

OK - try this batch file:
#@echo off
#setlocal EnableDelayedExpansion
#set Semaphore=d:\Data\Semaphore.txt
#
#echo> c:\test.vbs Set objFSO =
CreateObject("Scripting.FileSystemObject")
#echo>> c:\test.vbs Set file = objFSO.GetFile("%Semaphore%")
#echo>> c:\test.vbs wscript.quit (DateDiff("h",
file.DateLastModified,
Now)
^> 6)
#
#if exist "%Semaphore%" (
# cscript //nologo c:\test.vbs
# if !ErrorLevel! NEQ 0 goto :eof
# del "%Semaphore%"
# call batchfile.bat
#) else (
# echo. > %Semaphore%
# call batchfile.bat
#)

I placed a # to mark the beginning of each line. You must
remove them before running the batch file.
"Alberto Arias" <AlbertoArias@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
news:B4ACE61D-D9E3-4328-8EE1-8F9AD9DCD448@xxxxxxxxxxxxxxxx
i'm go to try explain it.
I want to do a script that it test the hour when a file was
created.
i'm runnig a batch with multiples treaths and i want to do one
file
to
use
this as one semafhore.

runing job==>
if file == exist then
see the creation hour of file
if the creation hour < 6 hours (local time) then
delete file and run batch
if not exit
if file >< exist then
create file and run job

My problem is see and compare the file creation time

I hope that i explained, and sorry for your time


"Pegasus (MVP)" wrote:


"Alberto Arias" <AlbertoArias@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote
in
message
news:54097669-7A00-4CE8-A8DA-BFD8A96F7183@xxxxxxxxxxxxxxxx
Hi,
I'm trying to compare 2 hour but i don't find the correct
script.
I'm trying to test the excution of one aplication with a flag.
i
like
check
the flag and test if the creation time of this (flag.txt) it's
6
horas
minor
to delete the file or retry it.
The problem it's that i can compare the system time with the
time
of
the
file flag.txt

I'm a newbie in script. I think it's easy but... i'm too
clumsy
to
find
where i have the problem...

Can you help me???

P.D: Sorry for me poor english

Unfortunately your post is not clear enough to give you
a good answer. I recommend you ask a friend with good
English skills to help you reword it.















.



Relevant Pages

  • Re: interact with user dialobbox user e passord
    ... "Pegasus (MVP)" wrote: ... Test the script from a Command Prompt. ... update box pops up while the macro is executing. ...
    (microsoft.public.scripting.vbscript)
  • Re: VBScript Help
    ... Pegasus, The value of strFileName is 9152008_nmap.log ... "Pegasus (MVP)" wrote: ... the command shell is the problem. ... how far the script goes, ...
    (microsoft.public.scripting.vbscript)
  • Re: VBScript
    ... "Pegasus (MVP)" wrote: ... net groups /domain ... Line1 @echo off ...
    (microsoft.public.win2000.general)
  • Re: interact with user dialobbox user e passord
    ... "Pegasus (MVP)" wrote: ... Test the script from a Command Prompt. ... update box pops up while the macro is executing. ...
    (microsoft.public.scripting.vbscript)
  • Re: Cant Access File with Extded Ascii Characters in File Name
    ... "Pegasus (MVP)" wrote: ... public EJBRMIResponse call ... echo FileName=xxx%FileName%xxx ...
    (microsoft.public.windowsxp.general)

Loading