CEBSS Posted October 16, 2008 Share Posted October 16, 2008 Hi Attached is a working demo scipt I have made. My problem is, I do not want to type "FileWriteLine" in front of each line in my creation of my .bat. Is there a shorter way? I have tried "FileSplitLine" to no avail. Regards Alistair PS: I am a new to programming. Link to comment Share on other sites More sharing options...
try67 Posted October 16, 2008 Share Posted October 16, 2008 Is there any particular reason you're reason a batch file? Why not simply write a script that does all of that? Link to comment Share on other sites More sharing options...
Pain Posted October 16, 2008 Share Posted October 16, 2008 $text = "@echo off" & @CRLF & _ "ECHO PLEASE WAIT WENA" & @CRLF & _ "echo ...........I SAID WAIT ..........." & @CRLF & _ "@echo off" & @CRLF & _ "ECHO PLEASE WAIT WENA" & @CRLF & _ "echo ...........I SAID WAIT ..........." & @CRLF & _ "@if not exist c:\ali goto 2" & @CRLF & _ "@del c:\ali\*.* /f /q" & @CRLF & _ "@echo hello this file exists >>\hello.log" & @CRLF & _ "date /t >>\hello.log" & @CRLF & _ "time /t >>\hello.log" & @CRLF & _ "@copy \deleted\test.iva \ali" & @CRLF & _ "@echo test.avi copied to ali >>\hello.log" & @CRLF & _ "@cd \ali" & @CRLF & _ "@\pkzip test test.iva " & @CRLF & _ "@echo test.avi has been zipped >>\hello.log" & @CRLF & _ "goto End" & @CRLF & _ ":2" & @CRLF & _ "@MD\ali" & @CRLF & _ "@echo ali is now made >>\ali.log" & @CRLF & _ "@copy \deleted\test.iva \ali" & @CRLF & _ "@echo test.avi copied to ali >>\ali.log" & @CRLF & _ "date /t >>\ali.log" & @CRLF & _ "time /t >>\ali.log" & @CRLF & _ "@cd \ali" & @CRLF & _ "@\pkzip test test.iva " & @CRLF & _ "@echo test.avi has been zipped >>\ali.log" & @CRLF & _ ":End" & @CRLF & _ "exit" & @CRLF or $text = "@echo off" & @CRLF $text &= "ECHO PLEASE WAIT WENA" & @CRLF $text &= "echo ...........I SAID WAIT ..........." & @CRLF $text &= "@echo off" & @CRLF $text &= "ECHO PLEASE WAIT WENA" & @CRLF $text &= "echo ...........I SAID WAIT ..........." & @CRLF $text &= "@if not exist c:\ali goto 2" & @CRLF $text &= "@del c:\ali\*.* /f /q" & @CRLF $text &= "@echo hello this file exists >>\hello.log" & @CRLF $text &= "date /t >>\hello.log" & @CRLF $text &= "time /t >>\hello.log" & @CRLF $text &= "@copy \deleted\test.iva \ali" & @CRLF $text &= "@echo test.avi copied to ali >>\hello.log" & @CRLF $text &= "@cd \ali" & @CRLF $text &= "@\pkzip test test.iva " & @CRLF $text &= "@echo test.avi has been zipped >>\hello.log" & @CRLF $text &= "goto End" & @CRLF $text &= ":2" & @CRLF $text &= "@MD\ali" & @CRLF $text &= "@echo ali is now made >>\ali.log" & @CRLF $text &= "@copy \deleted\test.iva \ali" & @CRLF $text &= "@echo test.avi copied to ali >>\ali.log" & @CRLF $text &= "date /t >>\ali.log" & @CRLF $text &= "time /t >>\ali.log" & @CRLF $text &= "@cd \ali" & @CRLF $text &= "@\pkzip test test.iva " & @CRLF $text &= "@echo test.avi has been zipped >>\ali.log" & @CRLF $text &= ":End" & @CRLF $text &= "exit" & @CRLF Use FileWrite. Link to comment Share on other sites More sharing options...
CEBSS Posted October 16, 2008 Author Share Posted October 16, 2008 Pain... I cannot thank you enough, it works like a charm. Thank you Alistair Link to comment Share on other sites More sharing options...
CEBSS Posted October 16, 2008 Author Share Posted October 16, 2008 One more thing How do I mark this topic closed Link to comment Share on other sites More sharing options...
Pain Posted October 16, 2008 Share Posted October 16, 2008 Edit your first post and add [solved] to the title. 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