ActiveX object CreateFolder() method stopped working in Edge with IE mode

Zhu, Ligong 260 Reputation points
2025-03-27T13:25:28.15+00:00

Hi,

We have a piece of JavaScript code to use ActiveX object to create a local folder in Edge with IE mode. It has been working fine for years for all users. This is the code:

activeXObject.CreateFolder(path) ; //path is a new local folder name such as "C:\Temp".

Starting from yesterday for some reason, we see this error message from the line above on one user's machine:

User's image

It still works fine for other users.

The security setting for IE option inside Edge is managed by our system administration. It is hard to image it would be different for one user.

Is that anything we can change to fix this issue?

Thanks,

Ligong

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,544 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yu Zhou-MSFT 15,261 Reputation points Microsoft External Staff
    2025-03-28T06:57:10.6833333+00:00

    Hi @Zhu, Ligong

    It only happens with one user, so it's usually related to user permissions. Please make sure that the user account running the script has the necessary permissions to create folders in the specified directory.

    You could try below:

    1. Check if you can manually create a new folder on that path.
    2. Make sure the path you are trying to create the folder in is valid and accessible. Avoid using special characters or reserved words in the folder name.
    3. Run the script with elevated privileges such as administrator.
    4. Test with another user account such as local admin account on that machine.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards,

    Yu Zhou

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.