1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Resolved Permission Denied using FileSystemObject in win10

Discussion in 'Windows 10' started by FuzMic, 2016/12/19.

  1. 2016/12/19
    FuzMic

    FuzMic Well-Known Member Thread Starter

    Joined:
    2006/05/25
    Messages:
    512
    Likes Received:
    5
    Experts i am sure you can help me out on this

    In VB6 i use the following to test for presence of files in my spool\printers folder

    FS = CreateObject("Scripting.FileSystemObject")
    set Folder = FS.GetFolder("C:\windows\system32\spool\printers\")

    As I suspect when i try the following in Win10

    if (Folder.Files.count = 0)

    I got err 70 Permission denied.

    No problem with win7 or xpwin

    How can i resolve this?
     
  2. 2016/12/19
    FuzMic

    FuzMic Well-Known Member Thread Starter

    Joined:
    2006/05/25
    Messages:
    512
    Likes Received:
    5
    I just found i can fix this by allowing read rights to the user for the folder.

    Funny though; there is only one user with admin rights in this Acer tabloid yet i have to set the read rights for the windows/system32/spool/printers folder for only Admin. Is there something i missed?
     

  3. to hide this advert.

  4. 2016/12/19
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Some dirs are System dirs and and admin user can do anything in them but will usually get a "continue" prompt before modifying a file. (reading a file modifies its meta data). A script bypasses the prompts only if permissions are set on the script or the dir.
     
  5. 2016/12/19
    FuzMic

    FuzMic Well-Known Member Thread Starter

    Joined:
    2006/05/25
    Messages:
    512
    Likes Received:
    5
    Ok Tony, how to bypass the prompt in a vb6 script, you sure know! Thanks!.
     
  6. 2016/12/20
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
  7. 2016/12/20
    FuzMic

    FuzMic Well-Known Member Thread Starter

    Joined:
    2006/05/25
    Messages:
    512
    Likes Received:
    5
    Tony you KNEW this refers to my hours on the POS printers. But i feel, irrespective what brand of the printer, this is an issue that need to be fixed. In fact, I am getting feedback that win 10 do exhibit these odd behavior every often.
    So how to set permissions on the script; still begging for your answer!

    More!!: Today all 3 Acer tablods gave, the only admin user. full access rights to the spool/printer folder and I DID NOTHING. Yesterday all 3 threw me out. Confused.
     
  8. 2016/12/20
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Rt click the script > Properties > Security tab
    You should be able to set ownership, permissions & special permissions.
    Can also rt click > Run as admin
     
  9. 2016/12/20
    FuzMic

    FuzMic Well-Known Member Thread Starter

    Joined:
    2006/05/25
    Messages:
    512
    Likes Received:
    5
    So there is no way do within a VB6 script, is it?
     
  10. 2016/12/21
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
  11. 2016/12/21
    FuzMic

    FuzMic Well-Known Member Thread Starter

    Joined:
    2006/05/25
    Messages:
    512
    Likes Received:
    5
    THANK YOU THANK YOU for the exposure, Tony!
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.