SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Advanced Member
    Join Date
    Sep 2011
    Posts
    524
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Permission error while deleting unzipped folder!!

    Is there any way to know in vbscript or qtp code that the particular object is in use or is free?

    Context for this is:

    I declared
    Set fso = CreateObject("Scripting.FileSystemObject")
    and then after some coding, I set this as nothing
    between this, I unzippped a file and then try to delete the unzipped folder after using it
    unzipped folder is not getting deleted and giving permission error
    Set fso = Nothing

    Can anyone please point me to right direction to troubleshoot this issue?

  2. #2
    Advanced Member
    Join Date
    Sep 2007
    Location
    Chennai, Tamil nadu, India
    Posts
    999
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Permission error while deleting unzipped folder!!

    By using IsObject function you can find. If you don't have delete access on that folder you can't delete it by scripting. If you add "On Error Resume Next" at the beginning you can avoid errors.
    i have never seen bugs sleeping

  3. #3
    Advanced Member
    Join Date
    Sep 2011
    Posts
    524
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Permission error while deleting unzipped folder!!

    Thanks prince for the reply. Actually, I found the issue. The issue is:

    In the code, if you insert breakpoint at a point in the code where the zipped file is unzipped (insert breakpoint here) and we are just going to manipulate and then delete the unzipped folder.

    When the script execution reaches the break point, just open the unzipped folder manually. After opening it manually, you will notice that thumbs.db file got created in the unzipped folder. Then, close the unzipped folder.

    Then, resume the script from break point. It will give Permission error at the line where code tries to delete the unzipped folder.

    If you let the script run without opening the folder manually, then it continues to run fine without any error

    This is the weird behavior that I find about this code for unzipping the zipped file, so I thought to post it.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:43 AM.

Copyright BetaSoft Inc.