Created
June 12, 2016 21:43
-
-
Save mschuwalow/bd78ebd5304b84a492c3b58417a92256 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Fancy Script for generating bat files from every filename that comes in via stdin. | |
Pass the directory to write to as an argument. | |
Brought to you by unicorn magic! | |
Kawoooosh.... | |
""" | |
import sys | |
if __name__ == "__main__": | |
print "Generating entries for:\n" | |
for elem in sys.stdin: | |
elem = elem[0:(len(elem) - 1)] | |
print elem | |
file = open(sys.argv[1] + "/" + elem + ".bat", "w+") | |
file.write("@echo off\n") | |
file.write("cmd.exe /c \"bash -c " + elem + " %1 %2 %3 %4 %5 %6 %7 %8 %9\"") | |
print "\ndone!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment