CrzyBoy2599 Posted December 24, 2009 Posted December 24, 2009 I am trying to write a script that will make about 2000 different batch files. I have a bunch of video files that I want to have a batch file linked to it so it can just open up in VLC. I have all of the file names already typed out in a text file and I need the script to write "START C:\Progra~1\VideoLAN\VLC\vlc.exe -vvv -f "X:\Movies\***MOVIE NAME FROM LIST HERE***" and then just save it as "MOVIE NAME.bat". I am new to scripting and am stuck on how to pull the data from the text file I have or how to save it as the name of the file with a .bat extension. Here is what I have so far, I'm pretty sure i need to add some sort of variable but I'm not sure: Run("notepad.exe") WinWaitActive("[CLASS:Notepad]") Send("START C:\Progra~1\VideoLAN\VLC\vlc.exe -vvv -f "X:\Movies\") ;send movie name here Send("!f") Send("x") WinWaitActive("Notepad") Send("y") ;save as .bat file here WinWaitClose("[CLASS:Notepad]") Any help would be amazing and greatly appreciated. Thanks =]
enaiman Posted December 24, 2009 Posted December 24, 2009 I'm feeling generous today ... XMas spirit Here you go: #include <File.au3> Global $MyFile = "your file full path and name here" Global $myArray _FileReadToArray($MyFile, $myArray) ;read all the lines in an array For $i = 1 To $myArray[0] FileOpen("X:\Movies\"&$myArray[$i]&".bat", 2) ;create *.bat file FileWrite("X:\Movies\"&$myArray[$i]&".bat", 'START C:\Progra~1\VideoLAN\VLC\vlc.exe -vvv -f ""X:\Movies\'&$myArray[$i]&'""') Next MsgBox(0, "Job Done", "Successfully created "&$myArray[0]&" batch files.") You better try the script with a shorter file (just a couple titles) just to see how it works; after that you can use the big file. Merry XMas SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
CrzyBoy2599 Posted December 24, 2009 Author Posted December 24, 2009 Oh man I love you haha it worked perfectly thank you!!
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