Action not working in Fixlet Debugger

Hello…I am new to this forum, so I will try to ask this correctly.

I am worrking on the following action script that I am having an issue with.

parameter “baseStaging” = “C:\Staging/”

if not exist folder "{parameter “baseStaging”}"
folder create "{parameter “baseStaging”}"
endif

If I run it just like it is above, it evaluates the statement and says the folder does not exist, but does not create the dolder.

If I remove the If and Endif from above it creates the folder.

Pretty sure I am just missing something.

Thanks

The action command you’re using will not create a folder. Try this:

parameter "baseStaging"="C:\Staging\"

if {not exist folder (parameter "baseStaging")}
waithidden {pathname of system folder}\cmd.exe /C mkdir {parameter "baseStaging" as string}
endif

jmaple,

Thanks for the repsonse, I tested it and it works. Do you know why mine does not work? Shouldn’t it have worked?

Part of the reason was your if statement wasn’t quite right. You had:

if not exist folder "{parameter "baseStaging"}"

You needed to encapsulate the statement after “if” in the relevance brackets:

if {not exist folder (parameter "baseStaging")}

The other part was the statement for actual folder creation is not a command action script would have understood if the “if” statement had evaluated true. The way I did it, you invoked CMD to do the folder creation.

EDIT: I didn’t notice you said it creates the folder without the if statement. That being the case, it was just because the relevance statement wasn’t encapsulated.

jmaple…Thanks for your help. I actually tested it with the following and it worked too.

if {not exist folder (parameter “baseStaging”)}
folder create "{parameter “baseStaging”}"
endif

It seems by just encapsulating the “not” it works.

Why are you creating this folder on the root drive? I would not recommend this. Either use the BES Client downloads folder, or use the Windows Temp folder, or create a folder within the Windows Temp folder.

This relevance gives you the pathname of the windows temp folder:

pathname of folders "Temp" of windows folders

It is a very bad idea to create a bunch of folders on the root of the drive. It gets very messy.

I was just testing something. Thanks for the information.

1 Like