Skip to content

Instantly share code, notes, and snippets.

@AScriver
Created October 7, 2022 18:23
Show Gist options
  • Save AScriver/159f9afdce20e00b348d65d4e04c66f7 to your computer and use it in GitHub Desktop.
Save AScriver/159f9afdce20e00b348d65d4e04c66f7 to your computer and use it in GitHub Desktop.
Converts a csv file to .xlsx
@if (@X)==(@Y) @end /* JScript comment
@echo off
if [%1]==[] (
echo Drag and drop a CSV file onto this one!
pause
)
cscript //E:JScript //nologo "%~f0" %*
exit /b %errorlevel%
@if (@X)==(@Y) @end JScript comment */
var ARGS = WScript.Arguments;
var objExcel = WScript.CreateObject("Excel.Application");
var objWorkbook = objExcel.Workbooks.Open(ARGS.Item(0));
objExcel.DisplayAlerts = false;
objExcel.Visible = false;
objWorkbook.SaveAs(ARGS.Item(1), 51);
objExcel.Quit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment