Shell

maikelj
Member Posts: 50
Hi everybody,
I'm having a problem with the function SHELL.
First I tried to rename "test1.txt" into "test2.txt".
This was correct.
But when I tried to rename the file "test 1.txt" into "text 2.txt", it did not work. And I think the spatial is the cause of this.
So my question is: How can I rename the file?
With kind regards,
Maikel
I'm having a problem with the function SHELL.
First I tried to rename "test1.txt" into "test2.txt".
This was correct.
But when I tried to rename the file "test 1.txt" into "text 2.txt", it did not work. And I think the spatial is the cause of this.
So my question is: How can I rename the file?
With kind regards,
Maikel
0
Comments
-
there's a special function for that named rename
i do not speak of the key renaming function, but of the rename(oldfilename,newfilename);
i tested that function with spaces (e.g. "rename('c:\tmp\b 1.txt','c:\tmp\b 2.txt');") and it works great under NA3.10, and NF2.6b
you may find it pressing F5, anf "F" key, afterwards.
good luck0 -
Thanks for the tip.
It works great.
I only had my eye on the SHELL function.
Maikel0 -
The reason for the non workin shell-function is that
shell('rename test 1.txt test 2.txt');
will be interpreted from the shell as copy with 4 arguments. (Try to do this in a dos-box - you will see the same effect)
To use correct with shell you have to set the filenames in brackets:tr[1] := 34; // set " into textvariable tr file1 := tr + 'test 1.txt' + tr; file2 := tr + 'test 2.txt' + tr; shell('copy',file1,file2);
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions