Home All Groups Group Topic Archive Search About

Execute Script on windows server 2003 R2 x64



Author
24 Oct 2007 1:44 PM
Gustavo
Hello mates, I just found a script, that deletes folder, subfolder and files
older than X hour, I wrote the script in my PC Win XP x32, but when I copy
the script file to the server, in few seconds, the content of the script
changes, and the original code is gone!!!.
How can I do to avoid this....?

Author
24 Oct 2007 6:36 PM
SlowBob
Please post listing of this script.

SlowBob

Show quote
"Gustavo" wrote:

> Hello mates, I just found a script, that deletes folder, subfolder and files
> older than X hour, I wrote the script in my PC Win XP x32, but when I copy
> the script file to the server, in few seconds, the content of the script
> changes, and the original code is gone!!!.
> How can I do to avoid this....?
Author
24 Oct 2007 8:34 PM
Gustavo
this is the code:
**********************************
Set fso=CreateObject("Scripting.FileSystemObject")
set fldr=fso.getFolder("c:\temp\")

'Aqui borra la(s) carpeta(s) contenidas en el directorio indicado arriba
''here the script deletes the folders and subfolders.

For Each Fld in Fldr.SubFolders
    If dateDiff("h",Fld.dateLastModified,Now)>1 then Fld.delete
Next

'******************************************************************
'here the script deletes the files
'Aqui borra la(s) archivo(s) contenidas en el directorio indicado arriba

For Each File in Fldr.files
    If dateDiff("h",File.dateLastModified,Now)>1 then File.delete
Next


**********************************

Show quote
"SlowBob" wrote:

> Please post listing of this script.
>
> SlowBob
>
> "Gustavo" wrote:
>
> > Hello mates, I just found a script, that deletes folder, subfolder and files
> > older than X hour, I wrote the script in my PC Win XP x32, but when I copy
> > the script file to the server, in few seconds, the content of the script
> > changes, and the original code is gone!!!.
> > How can I do to avoid this....?
Author
24 Oct 2007 10:01 PM
McKirahan
"Gustavo" <Gust***@discussions.microsoft.com> wrote in message
news:1A1A6A98-695C-409C-B613-13986666CD59@microsoft.com...
> Hello mates, I just found a script, that deletes folder, subfolder and
files
> older than X hour, I wrote the script in my PC Win XP x32, but when I copy
> the script file to the server, in few seconds, the content of the script
> changes, and the original code is gone!!!.
> How can I do to avoid this....?

Your script is more than an hour old thus it gets deleted.
Test for the name of the script before deleting each file.

Wait ... what do you mean "the content of the script changes"?
Author
25 Oct 2007 11:43 AM
Gustavo
thanks for the answer but the script is Ok, I tested, the issue is, that when
I copy the vbs file in my server with Windows Server 2003 R2, SP1, x64, the
content of the script changes, (yes just like you read this) the content
changes, and the new code looks like an encripted code.

The goal to resolve this issue was, change the file's attribute to read.

Show quote
"McKirahan" wrote:

> "Gustavo" <Gust***@discussions.microsoft.com> wrote in message
> news:1A1A6A98-695C-409C-B613-13986666CD59@microsoft.com...
> > Hello mates, I just found a script, that deletes folder, subfolder and
> files
> > older than X hour, I wrote the script in my PC Win XP x32, but when I copy
> > the script file to the server, in few seconds, the content of the script
> > changes, and the original code is gone!!!.
> > How can I do to avoid this....?
>
> Your script is more than an hour old thus it gets deleted.
> Test for the name of the script before deleting each file.
>
> Wait ... what do you mean "the content of the script changes"?
>
>
>

AddThis Social Bookmark Button