﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » .NET Forums » General .NET Discussion  » Override NTFS permissions in code</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 00:18:00 GMT</lastBuildDate><ttl>20</ttl><item><title>Override NTFS permissions in code</title><link>http://forum.strataframe.net/FindPost20374.aspx</link><description>Question:&lt;/P&gt;&lt;P&gt;If I have an application I wrote that executes under Windows login "generaluser", I now want my application in specific scenarios to write a file to a network folder to which "generaluser" does not have write NTFS permissions. How can I accomplish this?</description><pubDate>Tue, 28 Oct 2008 16:33:51 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: Override NTFS permissions in code</title><link>http://forum.strataframe.net/FindPost20400.aspx</link><description>thanks, all&amp;nbsp;I was hoping for was a namespace or starting place from someone who has done this, Google turned up a lot of options. I'll check out what you posted, appreciated as always.</description><pubDate>Tue, 28 Oct 2008 16:33:51 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: Override NTFS permissions in code</title><link>http://forum.strataframe.net/FindPost20386.aspx</link><description>You can go at this several ways and it can get somewhat complicated depending on the route that you take.&amp;nbsp; Let's first look at spawning an EXE to perform a certain action with different credentials.&amp;nbsp; &lt;/P&gt;&lt;P&gt;[codesnippet]Dim startInfo As New System.Diagnostics.ProcessStartInfo("C:\MyApp.exe")&lt;BR&gt;Dim password As New System.Security.SecureString()&lt;BR&gt;Dim process As System.Diagnostics.Process&lt;/P&gt;&lt;P&gt;'-- Build the secure password string&lt;BR&gt;For Each c As Char In "MyPassword"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; password.AppendChar(c)&lt;BR&gt;Next&lt;/P&gt;&lt;P&gt;'-- Set the security login credentials&lt;BR&gt;startInfo.UserName = "MyWindowsUser"&lt;BR&gt;startInfo.Domain = "MYDOMAIN"&lt;BR&gt;startInfo.Password = password&lt;/P&gt;&lt;P&gt;'-- Spawn the process&lt;BR&gt;process = System.Diagnostics.Process.Start(startInfo)&lt;/P&gt;&lt;P&gt;'-- If you want to wait for the process to exit you can wait like this&lt;BR&gt;process.WaitForExit()[/codesnippet]&lt;/P&gt;&lt;P&gt;Now if you want to create isolation levels within your assembly, it gets a lot more complicated.&amp;nbsp; You will have to apply security attributes and configure each client machine that will execute the code.&amp;nbsp; I am obviously not getting too deep here as this can become a really big tutorial in and of itself, but if you have this need, then a web search would probably be your best best as I ams ure that there are probably already some articles out on CodeProject or something along those lines showing how to do this.</description><pubDate>Tue, 28 Oct 2008 09:17:07 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>