CreateDir with variables?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Tourless
Pro Scripter
Posts: 69
Joined: Wed Jun 14, 2017 1:53 am
Location: NY

CreateDir with variables?

Post by Tourless » Tue Jul 20, 2021 6:16 pm

Hi Folks.

I'm not sure what's wrong with this...

Code: Select all

Month>varMonth
Day>varDay
Year>varYear
...
CreateDir>S:\dir\dir2\dir3\%varMonth%-%varDay%-%varYear%
I literally get a folder named %varMonth%-%varDay%-%varYear%. I use those over and over in my code but am only having a problem with them using CreateDir. So then I think ok, what if I make a folder and name it new folder, then rename it, but I can't see a function for renaming a folder?? Is that right? I'd hate to think I have to open explorer, navigate, click and F2 to rename a folder in my script. I'm sure that can't be right, I must be missing something that's right under my nose.
If anyone can point me in the right direction I'd be most appreciative.

User avatar
Grovkillen
Automation Wizard
Posts: 1128
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: CreateDir with variables?

Post by Grovkillen » Tue Jul 20, 2021 6:42 pm

You can use the CopyFolder> command and then the DeleteFolder> to "rename" a folder... but, I cannot understand why the script wouldn't take those variable in the name... are you sure they are set? Use the **BREAKPOINT** just before the CreateDir> and look in the variable "watch list".

You could also try to have a:

Code: Select all

Let>Temp_folder_path=S:\dir\dir2\dir3\%varMonth%-%varDay%-%varYear%
right before the CreateDir> command
Let>ME=%Script%

Running: 15.0.27
version history

Tourless
Pro Scripter
Posts: 69
Joined: Wed Jun 14, 2017 1:53 am
Location: NY

Re: CreateDir with variables?

Post by Tourless » Tue Jul 20, 2021 6:46 pm

That's why... I'm F8 testing and my variables are set way at the beginning of my script about 600 lines back. I knew it was right under my nose. Thank you!!

User avatar
Grovkillen
Automation Wizard
Posts: 1128
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: CreateDir with variables?

Post by Grovkillen » Tue Jul 20, 2021 6:50 pm

Glad to be able to help.
Let>ME=%Script%

Running: 15.0.27
version history

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts