Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

chrisbrain
Valued Contributor

Creating directories in QlikView Script

Is it possible to create directories in QlikView script?

I would like to store daily QVD dumps of data in a subfolder based on the year month and say, e.g.

2011\7\22\MyQvd.qvd

But I need to generate these folders on a daily basis.

1 Solution

Accepted Solutions
MVP
MVP

Creating directories in QlikView Script

mkdir is a command line command.

try

Execute cmd.exe /C mkdir c:\test

Stefan

10 Replies
Not applicable

Re: Creating directories in QlikView Script

i think it will work with a macro look here for synatx http://www.wisesoft.co.uk/scripts/vbscript_create_folder.aspx

chrisbrain
Valued Contributor

Re: Creating directories in QlikView Script

Thanks - I did think about macros but preferred to avoid it if possible - doesn't sound like it is though!

danielrozental
Honored Contributor II

Re: Creating directories in QlikView Script

Chris, if you use the execute command you can ran any DOS command like mkdir.

eg

execute mkdir directory

chrisbrain
Valued Contributor

Re: Creating directories in QlikView Script

Ah interesting!

OK so I am trying this:

execute mkdir c:\test;

But keep getting:

Script line error:

execute mkdir c:\test

The command works fine via a command prompt. Any ideas what I am missing?

MVP
MVP

Creating directories in QlikView Script

mkdir is a command line command.

try

Execute cmd.exe /C mkdir c:\test

Stefan

martin59
Valued Contributor II

Re: Creating directories in QlikView Script

Hi,

You have to allow the macro override security in the document properties (security tab)

capture.png

After that, you can also try something like that :

EXECUTE mspaint;

Hope that helps you

Martin

danielrozental
Honored Contributor II

Re: Creating directories in QlikView Script

Sorry, right syntax should be

execute cmd.exe /c mkdir c:\test;

chrisbrain
Valued Contributor

Creating directories in QlikView Script

Thanks all!

Execute cmd.exe /C mkdir c:\test

Works.

Martin - I think the check box you show in your screen shot is only for code in the macro module (not load script) - I think the correct check box is the 'Can Execute Externam Programs' in the Settings tab of the load script.

Not applicable

Re: Creating directories in QlikView Script

Here is a syntax to create a new folder in the same location of the QVW :

EXECUTE cmd.exe /C mkdir QVD;

Thanks.