CsM33 Posted September 20, 2006 Share Posted September 20, 2006 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 More sharing options...
The Kandie Man Posted September 20, 2006 Share Posted September 20, 2006 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 More sharing options...
CsM33 Posted September 20, 2006 Author Share Posted September 20, 2006 I don't get any errors but it doesnt show up in the directory I want. Link to comment Share on other sites More sharing options...
The Kandie Man Posted September 20, 2006 Share Posted September 20, 2006 (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 September 20, 2006 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 More sharing options...
CsM33 Posted September 20, 2006 Author Share Posted September 20, 2006 (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 September 20, 2006 by CsM33 Link to comment Share on other sites More sharing options...
CsM33 Posted September 20, 2006 Author Share Posted September 20, 2006 Ok I fixed it. Thanks for the help writing the code though cause I couldn't figure it out. Link to comment Share on other sites More sharing options...
The Kandie Man Posted September 20, 2006 Share Posted September 20, 2006 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 More sharing options...
CsM33 Posted September 20, 2006 Author Share Posted September 20, 2006 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 More sharing options...
Valuater Posted September 20, 2006 Share Posted September 20, 2006 (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 September 20, 2006 by Valuater Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now