|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Execute Script on windows server 2003 R2 x64
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....? 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....? 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....? "Gustavo" <Gust***@discussions.microsoft.com> wrote in message Your script is more than an hour old thus it gets deleted.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....? Test for the name of the script before deleting each file. Wait ... what do you mean "the content of the script changes"? 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"? > > >
Other interesting topics
|
|||||||||||||||||||||||