infor.com
concierge
infor u
developer portal
Posts
Categories
Groups
Hubs
Developer
Healthcare
Hospitality
Public Sector
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
Your Groups
User Groups
Migrated Forums
FSM/HCM/S3 - Infor Lawson 10.x
HCM/S3 - Learning and Development
HCM/S3 - Global HR
HCM/S3 - Talent Acquisition
HR Service Delivery
Human Capital Management (HCM) - EMEA
Infor Configuration Management for Service Industries
Lawson - Business Intelligence
Lawson - Financials
Lawson - Human Resources
Lawson - Supply Chain
Lawson - Supply Chain Management
Lawson - Technology
MSCM on Landmark
About
Community News
Email Community Support
Home
Groups
Process Automation (IPA) Community
Move file via cmd node
Legacy Contributor
Has anyone used the cmd node to move a file to another directory?
Thanks,
Find more posts tagged with
Accepted answers
Legacy Contributor
I used mv {filepath} {newfilepath} and that worked. I now need to rename the file from file.txt to file{date}.txt
Any ideas?
Thank you,
Legacy Contributor
In addition to mv, the cp (copy) command will work in the syscmd node as well. You can copy the file to a new directory with a new name. If you want to add a datetimestamp, create a variable which contains the stamp and use it as part of the new file name in the cp or mv command.
All comments
Legacy Contributor
I used mv {filepath} {newfilepath} and that worked. I now need to rename the file from file.txt to file{date}.txt
Any ideas?
Thank you,
rmbell
We have, but DOS commands work on ours also as we are Windows, so we can either use move oldfilepatholdname to newfilepath
ewfilename, or ren oldfile newfile.
Legacy Contributor
In addition to mv, the cp (copy) command will work in the syscmd node as well. You can copy the file to a new directory with a new name. If you want to add a datetimestamp, create a variable which contains the stamp and use it as part of the new file name in the cp or mv command.
Legacy Contributor
I just wanted to add to this...
For just a simple date stamp of the day, I use...
DateStamp = DateString(today(),yyyymmdd');
To have the hours and minutes added, "hhmm" in ( needed for more than 1 run in a day) I think it's best to use the format date so there is no space " " in the file name and then no quotes needed for the command line.
Use DateStamp = format.formatDate(dateString, "yyyyMMddHHmm") making sure to use capitol "MM" for months or you will get back the minutes if using lowercase.
Then using the mv command {filepath} {newfilepath} You can use the new filepath to change the name of the file to whatever you want, it does not need to match the original for name. E.g.
mv {filepath} {<!newfilepath>/<!newFileName><!DateStamp>.txt}
note: the default variable is DateString(jsDate,'yyyymmdd hhmmss') and if you look at the pflow.js you can see the space is coded in... retVal = yyyy + MM + dd + ' ' + hh + min + ss;
annoying if you ask me...
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Help