Overview
When an Windows administrator attempts to access a user's folder or file, the administrator receives an "Access is Denied" message.
This behavior occurs because a user or an administrator applied a Group Policy object to redirect the user's folder to a network share (\\Server\Share\UserName), and did not change the Grant the user exclusive rights default setting.
Only the user, to whom the folder belongs, has authorization to access this folder when this default setting is used.
Solution
An administrator must take ownership of the folder in order to change the Access Control List (ACL) or to access the folder.
To take ownership of a folder, follow these steps:
Right-click the desired folder, click Properties, and then click
the Security tab.
Click OK when you receive the following message:
You only have permission to view the current security information on username
Click Advanced, and then click the Owner tab.
Select a new owner, select Replace owner on subcontainers and objects, and then click OK.
Click Yes when you receive the following message:
You do not have permission to read the contents of directory path and directory name. Do you want to replace the directory permissions with permissions granting you Full Control?
Close, and then reopen Properties to refresh the ACL.
Note: The permissions for this folder are now being inherited from the parent folder. In most cases you should block inheritance from the parent by clearing the Allow inheritable permissions from parent to propagate to this object check box. You will then be able to change the permissions on this folder.
Thursday, October 15, 2009
Monday, September 21, 2009
Call a method in another assembly with C#
// Load the assembly
Assembly assembly = Assembly.LoadFrom(@"C:\App\bin\xyz.dll");
// Create the actual type
Type classType = assembly.GetType("xyz", true, false);
// Create an instance of this type and verify that it exists
object dynamicObject = Activator.CreateInstance(classType);
if (dynamicObject != null)
{
// Verify that the method exists and get its MethodInfo object
MethodInfo invokedMethod = classType.GetMethod("Start");
if (invokedMethod != null)
{
object[] parameters = new object[2];
parameters[0] = jobType;
parameters[1] = argument;
// Invoke the method with the parameters
invokedMethod.Invoke(dynamicObject, parameters);
}
}
Assembly assembly = Assembly.LoadFrom(@"C:\App\bin\xyz.dll");
// Create the actual type
Type classType = assembly.GetType("xyz", true, false);
// Create an instance of this type and verify that it exists
object dynamicObject = Activator.CreateInstance(classType);
if (dynamicObject != null)
{
// Verify that the method exists and get its MethodInfo object
MethodInfo invokedMethod = classType.GetMethod("Start");
if (invokedMethod != null)
{
object[] parameters = new object[2];
parameters[0] = jobType;
parameters[1] = argument;
// Invoke the method with the parameters
invokedMethod.Invoke(dynamicObject, parameters);
}
}
Wednesday, September 16, 2009
Join workgroup file with Access 2007
1. In Access 2007, open a trusted database, or enable macros in the existing database.
2. Press CTRL+G to open the Immediate window.
3. Type the following line of code, and then press ENTER.
DoCmd.RunCommand acCmdWorkgroupAdministrator
4. In the Workgroup Administrator dialog box, click Join, and then click Browse.
5. Locate and then click the following file, and then click Open:
C:\Program Files\Common Files\system\System.mdw
6. In the Workgroup Administrator dialog box, click OK, and then click Exit
OR
Make a shortcut with the following : "path to 2007msaccess.exe" "path to mdb" /wrkgrp "path to secure.mdw"
2. Press CTRL+G to open the Immediate window.
3. Type the following line of code, and then press ENTER.
DoCmd.RunCommand acCmdWorkgroupAdministrator
4. In the Workgroup Administrator dialog box, click Join, and then click Browse.
5. Locate and then click the following file, and then click Open:
C:\Program Files\Common Files\system\System.mdw
6. In the Workgroup Administrator dialog box, click OK, and then click Exit
OR
Make a shortcut with the following : "path to 2007msaccess.exe" "path to mdb" /wrkgrp "path to secure.mdw"
Thursday, July 16, 2009
Embed script : ScriptLoadFailedException
Problem :
Error: Sys.ScriptLoadFailedException: The script '.../WebResource.axd?d=...' failed to load. Check for: Inaccessible path.
Script errors. (IE) Enable 'Display a notification about every script error' under advanced settings.
Missing call to Sys.Application.notifyScriptLoaded().
Solution :
Add this line at the end of the javascript that is loaded :
if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
Error: Sys.ScriptLoadFailedException: The script '.../WebResource.axd?d=...' failed to load. Check for: Inaccessible path.
Script errors. (IE) Enable 'Display a notification about every script error' under advanced settings.
Missing call to Sys.Application.notifyScriptLoaded().
Solution :
Add this line at the end of the javascript that is loaded :
if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
Friday, June 19, 2009
ASP.NET: 3 Steps to embed web resources into dll
If you want to make your own custom control. Yes, custom - not user control. You have something that should work good, everywhere and run from single dll. But how to store images, javascript and other stuff inside this dll? Everything looks fine, but it always cause problems. I decided to write 3 simple steps to embed javascript into your custom control.
Add your JS file to custom control project. Right click on the file - Properties - Build Action - Embedded Resource
Open your AssembyInfo.cs file and add following line
[assembly: System.Web.UI.WebResource("YourNamespace.FileName.js", "application/x-javascript")]
In your custom control OnLoad event add following line:
Page.ClientScript.RegisterClientScriptResource(this.GetType(), "YourNamespace.FileName.js");
That's all!
Add your JS file to custom control project. Right click on the file - Properties - Build Action - Embedded Resource
Open your AssembyInfo.cs file and add following line
[assembly: System.Web.UI.WebResource("YourNamespace.FileName.js", "application/x-javascript")]
In your custom control OnLoad event add following line:
Page.ClientScript.RegisterClientScriptResource(this.GetType(), "YourNamespace.FileName.js");
That's all!
Wednesday, April 22, 2009
Debug with Visual Studio 2005 and IE8
IE 8 has a feature called Loosely-Coupled Internet Explorer (LCIE) which results in IE running across multiple processes.
http://www.microsoft.com/windows/internet-explorer/beta/readiness/developers-existing.aspx#lcie
Older versions of the Visual Studio Debugger get confused by this and cannot figure out how to attach to the correct process. You can work around this by disabling the process growth feature of LCIE. Here's how:
1) Open RegEdit
2) Browse to HKEY_LOCALMACHINE -> SOFTWARE -> Microsoft -> Internet Explorer -> Main
3) Add a dword under this key called TabProcGrowth
4) Set TabProcGrowth to 0
Since you are running on Windows Server 2003, this is all you should need to do. If you run into the same problem on Vista or newer, you will also need to turn off protected mode.
http://www.microsoft.com/windows/internet-explorer/beta/readiness/developers-existing.aspx#lcie
Older versions of the Visual Studio Debugger get confused by this and cannot figure out how to attach to the correct process. You can work around this by disabling the process growth feature of LCIE. Here's how:
1) Open RegEdit
2) Browse to HKEY_LOCALMACHINE -> SOFTWARE -> Microsoft -> Internet Explorer -> Main
3) Add a dword under this key called TabProcGrowth
4) Set TabProcGrowth to 0
Since you are running on Windows Server 2003, this is all you should need to do. If you run into the same problem on Vista or newer, you will also need to turn off protected mode.
Saturday, April 18, 2009
Disabling script debugging in VS 2008
Disable all script debugging
Open a new command prompt (start->run, cmd.exe). If you are on a 64-bit computer this needs to be a 32-bit prompt (start->run, c:\windows\syswow64\cmd.exe)
reg add HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\AD7Metrics\Engine\{F200A7E7-DEA5-11D0-B854-00A0244A1DE2} /v ProgramProvider /d {4FF9DEF4-8922-4D02-9379-3FFA64D1D639} /f
(re)enable all script debugging
reg add HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\AD7Metrics\Engine\{F200A7E7-DEA5-11D0-B854-00A0244A1DE2} /v ProgramProvider /d {170EC3FC-4E80-40AB-A85A-55900C7C70DE} /f
Open a new command prompt (start->run, cmd.exe). If you are on a 64-bit computer this needs to be a 32-bit prompt (start->run, c:\windows\syswow64\cmd.exe)
reg add HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\AD7Metrics\Engine\{F200A7E7-DEA5-11D0-B854-00A0244A1DE2} /v ProgramProvider /d {4FF9DEF4-8922-4D02-9379-3FFA64D1D639} /f
(re)enable all script debugging
reg add HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\AD7Metrics\Engine\{F200A7E7-DEA5-11D0-B854-00A0244A1DE2} /v ProgramProvider /d {170EC3FC-4E80-40AB-A85A-55900C7C70DE} /f
Subscribe to:
Posts (Atom)