Photo Gallery
Member List
Search
Calendars
FAQ
Ticket List
Log Out
Forums
Register
Login
My Profile
Inbox
Address Book
My Subscription
My Forums
Self Modifying Script
Logged in as: Guest
arrSession:exec spGetSession 2,16,52703
Active Users: There are
0
members and
0
guests.
Users viewing this topic: none
Printable Version
All Forums
>>
[Scripting]
>>
Post a VBScript
>> Self Modifying Script
Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page:
[1]
Login
Message
<< Older Topic
Newer Topic >>
Self Modifying Script -
10/15/2007 7:20:04 PM
TNO
Posts: 1036
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status:
offline
I was reorganizing the thousands of random tidbits on my computer and came across this old script:
Const n = 1 Dim f, a, s, w w = WScript.ScriptFullName Set f = CreateObject("Scripting.FileSystemObject") Set a = f.OpenTextFile(w, 1) a.SkipLine s = chr(13) & Chr(10) & a.ReadAll a.Close Set a = f.CreateTextFile(w, True) a.Write "Const n = " & n + 1 & s a.Close WScript.echo "This script has been run " & n & " times"
This script shows the concept of a program modifying itself. I don't see any practical purpose to this at the moment, but someone somewhere might.
Edit: Code Cleanup
< Message edited by
TNO
--
11/12/2007 12:22:15 AM
>
_____________________________
Consolidated Script Component:
The Acid Test
A universe of complexity...
Revisions: 1
|
Post #: 1
RE: Self Modifying Script -
10/25/2007 4:09:50 PM
Meg
Posts: 123
Score: 2
Joined: 7/13/2006
From: Australia
Status:
offline
Thats a great idea, I will use that in something.
(in reply to
TNO
)
Post #: 2
If you found our site useful please link to us
<a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>
.
All Forums
>>
[Scripting]
>>
Post a VBScript
>> Self Modifying Script
Page:
[1]
Jump to:
Select a Forum
All Forums
----------------------
[Welcome]
- - Forum Rules
- - Test Posting Messages
- - New Member Area/Introduction
[Scripting]
- - WSH & Client Side VBScript
- - WSH & Client Side VBScript Tutorial
- - Post a VBScript
- - Windows PowerShell
- - ASP
- - ASP.NET
- - Windows Script Components
[General Forum]
- - Other Programming/Scripting Languages
- - Suggestions & Feedback
- - Off-Topic Lounge
New Messages
No New Messages
Hot Topic w/ New Messages
Hot Topic w/o New Messages
Locked w/ New Messages
Locked w/o New Messages
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
Forum Software ©
ASPPlayground.NET
Advanced Edition
2.5.5 ANSI