Dynamic Create File Directory
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Is there a tool to dynamically create a new file directory on the hard drive (or network drive); whereby the file directory name would be a field in the incoming data, and the file would be a report coming from the Render tool?
I’ve used the command prompt tool to create directories (MKDIR) but never been able to use dynamic naming.
Solved! Go to Solution.
- Labels:
- Developer Tools
- Dynamic Processing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I use the Run Command tool for this. In a formula tool before the Run Command, I make a field the will be something like this: "MKDIR " + [DirectoryField], I then remove all other fields and feed that into the Run Command tool to make a batch file (Write Source/Output) and run that batch file (Run External Program). You can use Block Until Done to make sure that your folders are created before saving to that directory.
Kane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Can someone post a working example of this configuration?
I'm trying to use Run Command to create folder but I'm getting "Either an Output connection or Input connection is required"
When I specify ma *.bat file in Output it says the format is not known
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Attached is an example that allows you to enter different folders and requires a full path
- Text input that has the path to the folder in a field called "DIR", in my case I entered the field value as D:\mytest.
- Formula tool to write a command for a bat, this is allowing me to run the second batch with different parameters (there are a lot of ways I could approach this).
- Run tool outputs the batch file to run and then configure to run it, attached to the Run tool is another batch that actually does the mkdir, the input is a log that shows whether the directory was created or if the directory already exists.
Let me know if this works for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
What is the command within your "folder.bat" file ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You would use the following command to run it:
folder.bat c:\temp\MyFolderName
The batch script contains the following where %1 is the first input from the cmd line:
@Echo off IF EXIST %1 ( ECHO Folder exists > folder.log) ELSE ( MKDIR %1 && echo Created folder > folder.log )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks a lot for your prompt reply. That was very helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I got the sample workflow to work, but for some reason when I plug that to my other workflow, the run_mkdir.bat has the command inside quotations and is not doing anything.
for example: "folder.bat C:\myDIr\Test"
When I run the snippet as is in a separate workflow; there is no quotations " " so it is working and creating the folder. Any idea what I might be missing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Actually I want to create a folder for today's date using DateTimeToday()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I got this. The delimiter was set to zero and so it was messing things up. Its all good now. Thanks.
