I am writing code to modify files contained on our file servers. A majority of our users work from MAC's and they have created folder structure that exceeds the 260 character limit.
I am able to get into the folder using Cmdlet's from a module called NTFSsecurity which has a Get-ChildItem2 cmdlet. It also has a Remove-Item2 and Get-Item2 both able to work with longer paths. But the module does not have an alternative method for Add-Content.
I need a way to write to the file in question contained in this long path. I have been searching for days and have come up empty.
Anyone have any ideas as too how I can write to a file contained in a long path structure?
Thanks in advance for any and all help...
Wayne
Path Too Long
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- SAPIEN Support Forums
- Posts: 945
- Last visit: Thu Oct 22, 2015 1:10 pm
Path Too Long
This is an automated post. A real person will respond soon.
Thank you for posting, waynecierkowski.
Here are some hints to help you get an accurate and complete answer to your question.
Ask in the best forum:
Anticipate follow-up questions!
Did you remember to include the following?
*** Make sure you do not post any licensing information ***
Thank you for posting, waynecierkowski.
Here are some hints to help you get an accurate and complete answer to your question.
Ask in the best forum:
- - Scripting question? For questions about Windows PowerShell or other scripting languages, use Scripting Answers.
- Software question? For questions about PowerShell Studio, PrimalScript, or other SAPIEN products, use Product Support Forums for Registered Customers.
- Trial question? For questions about trial versions of any SAPIEN product, use Trial Software Questions.
Anticipate follow-up questions!
Did you remember to include the following?
- 1. Product, version and build
2. 32 or 64 bit product
3. Operating system, e.g. Windows 7 64 bit.
4. Attach a screenshot, if applicable
5. Attach logs, crash reports, etc., in a ZIP file
*** Make sure you do not post any licensing information ***
- waynecierkowski
- Posts: 28
- Last visit: Mon Jul 10, 2023 10:51 am
Re: Path Too Long
I tried this out in the PowerShell console and I still get the same error, The specified path, file name, or both are too long...
Re: Path Too Long
Map the path further down.waynecierkowski wrote:I tried this out in the PowerShell console and I still get the same error, The specified path, file name, or both are too long...
- waynecierkowski
- Posts: 28
- Last visit: Mon Jul 10, 2023 10:51 am
Re: Path Too Long
Maybe I'm missing something but I tried mapping down further in the folder tree and I still get the error.
I've attached a screen shot of my PS Session where I tried this.
I've attached a screen shot of my PS Session where I tried this.
- Attachments
-
- PS-Mapping.png (95.33 KiB) Viewed 3678 times
Re: Path Too Long
You are going to have to install Mac support on the server. The issue is most likely due to illegal characters in the filenames. The Mac support, in most case, makes this work correctly.
This is not really a scripting issue. It is a compatibility and deployment issue.
This is not really a scripting issue. It is a compatibility and deployment issue.
- waynecierkowski
- Posts: 28
- Last visit: Mon Jul 10, 2023 10:51 am
Re: Path Too Long
Not really. I have it working and I discovered the solution in the help section for New-PSDrive in PowerShell studio.
Please see the attached screen shot.
Please see the attached screen shot.
- Attachments
-
- PSDrive-Mapping.png (28.8 KiB) Viewed 3676 times