Sign in to follow this  
Followers 0
CsM33

Question about filewrite

9 posts in this topic

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

I don't get any errors but it doesnt show up in the directory I want.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Ok I fixed it. Thanks for the help writing the code though cause I couldn't figure it out.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0