dcsimg
Results 1 to 7 of 7

Thread: Creating Folder (Mkdir)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    101

    Creating Folder (Mkdir)

    How create Folder in "Program File" Folder? This destination Denied.
    After installation I want to create a folder in program file but there is an error message as below:
    Name:  Access Denied Message.JPG
Views: 186
Size:  12.0 KB

    and I think this error message is due to the Access permission (as shown below )of the destination folder!
    Can you help me and tell me how can I create a folder in this destination folder?
    Name:  Access Denied.JPG
Views: 185
Size:  23.4 KB

    Sincerely
    Mahmood Khaleel Pirani
    #MKhP7

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,279

    Re: Creating Folder (Mkdir)

    The application needs to be run "As Administrator". Your installation package should be creating any needed folders during installation, not after.

    In Windows, there are folders provided to save application settings, user settings, and more. Maybe if you provide more details, we can offer suggestions/solutions.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    101

    Re: Creating Folder (Mkdir)

    Quote Originally Posted by LaVolpe View Post
    The application needs to be run "As Administrator". Your installation package should be creating any needed folders during installation, not after.

    In Windows, there are folders provided to save application settings, user settings, and more. Maybe if you provide more details, we can offer suggestions/solutions.
    Ok, I got it But How to create subfolders during packaging of my App? I have problem there. Therefore I decided to create subfolders after Installing the App.

  4. #4
    Fanatic Member
    Join Date
    Dec 2014
    Posts
    813

    Re: Creating Folder (Mkdir)

    Code:
    Declare Function IsUserAnAdmin Lib "Shell32" Alias "#680" () As Integer
    this will tell u if your program is currently in Admin mode or not.
    you can check this thread for more info about how to make your program run as admin.

    http://www.vbforums.com/showthread.p...-automatically

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    101

    Re: Creating Folder (Mkdir)

    Thank you I made changes in (SETUP.LST) file to solve my problem, I will use your API for my next work, However I haven't enough knowlagde on it

  6. #6
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,663

    Re: Creating Folder (Mkdir)

    If we're talking about sub-folders anywhere within C:\Program Files or C:\Program Files (x86), I think it's an absolutely horrible idea for a program to reach back into those folders and do anything at all (after initial installation). That's precisely what things like C:\ProgramData, C:\Users\[WhoEverYouAre]\Documents, or even the registry are for. Or, you could even create your own sub-folder in the C:\Users\[WhoEverYouAre]\YourSubFolder area. Or, if you've got a file-server on your system, use that for your data.

    Best Regards,
    Elroy
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    101

    Re: Creating Folder (Mkdir)

    Quote Originally Posted by Elroy View Post
    If we're talking about sub-folders anywhere within C:\Program Files or C:\Program Files (x86), I think it's an absolutely horrible idea for a program to reach back into those folders and do anything at all (after initial installation). That's precisely what things like C:\ProgramData, C:\Users\[WhoEverYouAre]\Documents, or even the registry are for. Or, you could even create your own sub-folder in the C:\Users\[WhoEverYouAre]\YourSubFolder area. Or, if you've got a file-server on your system, use that for your data.

    Best Regards,
    Elroy
    Many thanks dear Elroy for your comment. I know that it shouldn't be like that, but I have problem to create subfolders for my App. druring Packaging, therefore I tried to create subfolders after installation. For Now I got an idea to make changes in (SETUP.LST) file, and still I have problem I don't know how to create subfolders for my Apps. I want to create subfolders for different file types!!!
    If you have an idea I appreciate your help

    #MKhP7

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width