Adapt to batch file