Jump to content

Question about filewrite


CsM33
 Share

Recommended Posts

In the help file it says,

FileWrite

( filehandle or "filename", "line" )

But I'm confused and don't know if it works for all types of files. Someone in my other thread made a line of code for a batch program like this,

FileWrite("C:\haxxoBPG\BATCH\Shutdown.bat", "@Echo Off" & @CRLF & "shutdown -s" & @CRLF & "exit")

How would I write this

WScript.Sleep 10
WScript.Sleep 10
Set WshShell = WScript.CreateObject("WScript.Shell")
do
WshShell.Run "notepad"
WScript.Sleep 100
WshShell.AppActivate "notepad"
loop
Link to comment
Share on other sites

Try this:

FileWrite(@HomeDrive & "\test.vbs","WScript.Sleep 10" & @CRLF & "WScript.Sleep 10" & @CRLF & "Set WshShell = WScript.CreateObject("WScript.Shell")" & @CRLF & _
"do" & @CRLF & "WshShell.Run "notepad"" & @CRLF & "WScript.Sleep 100" & @CRLF & "WshShell.AppActivate "notepad"" & @CRLF & "loop")

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

Let me see the directory you specified and your full code. It is possible you specified an invalid directory via a logical error in your code.

Edited by The Kandie Man

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

Entire Code

msgbox(4,"Installation","Do you want to install the haXxo Basic Programs Pack?  C:\HaxxoBPG\")
DirCreate ( "C:\HaxxoBPG" )
DirCreate ( "C:\HaxxoBPG\Batch" )
DirCreate ( "C:\HaxxoBPG\VB" )
DirCreate ( "C:\HaxxoBPG\REG" )
FileWrite("C:\haxxoBPG\BATCH\Shutdown.bat", "@Echo Off" & @CRLF & "shutdown -s" & @CRLF & "exit")
FileWrite("C:\haxxoBPG\BATCH\Restart.bat", "@Echo Off" & @CRLF & "shutdown -r" & @CRLF & "exit")
FileWrite("C:\haxxoBPG\Batch\ForcedShutdown.bat", "@Echo Off" & @CRLF & "shutdown -f" & @CRLF & "exit")
FileWrite("C:\haxxoBPG\Batch\InfiniteLoopVirus.bat", "@Echo Off" & @CRLF & "START" & @CRLF & "Msg * FUCK YO COUCH" & @CRLF & "GOTO START" & @CRLF & "Exit")

I want that one to go in the VB directory.

Edited by CsM33
Link to comment
Share on other sites

Entire Code

msgbox(4,"Installation","Do you want to install the haXxo Basic Programs Pack?  C:\HaxxoBPG\")
DirCreate ( "C:\HaxxoBPG" )
DirCreate ( "C:\HaxxoBPG\Batch" )
DirCreate ( "C:\HaxxoBPG\VB" )
DirCreate ( "C:\HaxxoBPG\REG" )
FileWrite("C:\haxxoBPG\BATCH\Shutdown.bat", "@Echo Off" & @CRLF & "shutdown -s" & @CRLF & "exit")
FileWrite("C:\haxxoBPG\BATCH\Restart.bat", "@Echo Off" & @CRLF & "shutdown -r" & @CRLF & "exit")
FileWrite("C:\haxxoBPG\Batch\ForcedShutdown.bat", "@Echo Off" & @CRLF & "shutdown -f" & @CRLF & "exit")
FileWrite("C:\haxxoBPG\Batch\InfiniteLoopVirus.bat", "@Echo Off" & @CRLF & "START" & @CRLF & "Msg * FUCK YO COUCH" & @CRLF & "GOTO START" & @CRLF & "Exit")

I want that one to go in the VB directory.

Hmmm, i approve of the first 3 bat scripts. They can be useful additions for automating the shutdown process of a computer. I see the last one you call the loop virus. Though it doesn't look to be that malicious, more anoying, just don't send it to people.

Real programmers don't make viruses, usually they are made by some really immature person with a mediocre knowledge of scripting and programming. Just don't fall down that path, there is absolutely no future in it. Trust me, i would know, i was very much young once.

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

Hmmm, i approve of the first 3 bat scripts. They can be useful additions for automating the shutdown process of a computer. I see the last one you call the loop virus. Though it doesn't look to be that malicious, more anoying, just don't send it to people.

Real programmers don't make viruses, usually they are made by some really immature person with a mediocre knowledge of scripting and programming. Just don't fall down that path, there is absolutely no future in it. Trust me, i would know, i was very much young once.

You need not worry, it's for my brother. And for the record, I'm not young and I don't have any interest in viruses.

Link to comment
Share on other sites

You need not worry, it's for my brother. And for the record, I'm not young and I don't have any interest in viruses.

Really!!!...???

FileWrite("C:\haxxoBPG\Batch\InfiniteLoopVirus.bat", "@Echo Off" & @CRLF & "START" & @CRLF & "Msg * FUCK YO COUCH" & @CRLF & "GOTO START" & @CRLF & "Exit")

8(

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...