Skip to content

Instantly share code, notes, and snippets.

@ralfbecher
Forked from nate-untiedt/wblGen.bat
Last active September 7, 2016 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ralfbecher/7c3284183c225f7251ea1d7a664e3211 to your computer and use it in GitHub Desktop.
Save ralfbecher/7c3284183c225f7251ea1d7a664e3211 to your computer and use it in GitHub Desktop.
A simple batch file that automatically generates the wblfolder.wbl for your Qlik Sense visualization extension.
@echo off
REM wblGen.bat - v 1.0.0 - 2015-10-09
REM Description:
REM A simple batch file that automatically generates the wblfolder.wbl for your Qlik Sense visualization extension.
REM
REM Author: Nate Untiedt - Analytics8 - nuntiedt@analytics8.com
REM
REM Credit to: http://stackoverflow.com/a/8387078
setlocal EnableDelayedExpansion
for /L %%n in (1 1 500) do if "!__cd__:~%%n,1!" neq "" set /a "len=%%n+1"
setlocal DisableDelayedExpansion
echo Deleteing wbfolder.wbl...
del wbfolder.wbl
echo Generating wbfolder.wbl...
REM Iterate through entire directory recursively
for /r . %%g in (*) do (
set "absPath=%%g"
setlocal EnableDelayedExpansion
REM Trim off the absolute portion of the path
set "relPath=!absPath:~%len%!"
REM Write each entry to wbfolder.wbl
IF /I NOT !relPath!==wblGen.bat echo(!relPath!; >> wbfolder.wbl
endlocal
)
Echo Wbfolder.wbl generation complete!
REM delete self after job is done
del wblGen.bat
@ralfbecher
Copy link
Author

Don't include wblGen.bat itself.

@ralfbecher
Copy link
Author

Delete batch file after job is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment