Question about Microsoft Visual Basic 6.0 (361-00686) for PC

1 Answer

Getting permission denied error with Kill

Hi ,
I am writing a log file handling program. I am using the ''Kernal32'' function lopen and lclose for calculating the size of file .
I am zipping file and want to delete a old log file but when i am deleting the file with
Kill ''C:demo_logfilelog estlog.log'' I am getting permission denied error.

Please Help me !!!!

Posted by on

  • 14 more comments 
  • tejashree_lo Jun 22, 2009

    Yes I did..

    Public Function GetLogFileSize(FilePath As String) As Double
    Dim Pointer As Long
    Dim sizeofFile As Long
    Pointer = lOpen(FilePath, OF_READ) 'size of the file
    sizeofFile = GetFileSize(Pointer, lpFSHigh)
    GetLogFileSize = sizeofFile '& " bytes" 'lclose Pointer
    End Function

    this is the function which I am using to calaulate the size of file...

  • tejashree_lo Jun 22, 2009

    Yes i did...

  • tejashree_lo Jun 22, 2009

    it is read only..

    but when I clear the check box of read only, next time its again becoming read only(without running program also)

    its not allowing me to remove the read-only permission.

    I have system administrator rights

  • tejashree_lo Jun 22, 2009

    Its not allowing me to remove read-only permission

  • tejashree_lo Jun 22, 2009

    "Use simple file sharing" was already unchecked ....

  • tejashree_lo Jun 22, 2009

    I am using VB 6.0

    I have to write script for deleting the file , I cant delete it manually ....

    Is there any other way to delete a file except Kill..

  • tejashree_lo Jun 23, 2009

    Thanks :)

  • tejashree_lo Jun 23, 2009


    I have another problem..

    I want to create a folder in registry and read and write from the registry using VB 60

    Please Help!!!!!!!!!

  • tejashree_lo Jun 23, 2009


    I have another problem..

    I want to create a folder in registry and read and write from the registry using VB 60

    Please Help!!!!!!!!!

  • tejashree_lo Jun 23, 2009

    Thanx a lot :)

    Actually i hav to pass source file path and destination file path to registry(In some folder) and want to read those paths from the registry...

  • tejashree_lo Jun 24, 2009


    What is mnuMRU?

    I want to create a folder in registry and save source and destination file path..

    I have tried below but its not working

    SaveSetting App.Title, "HKEY_CURRENT_USER\MyTestKey", "Testlog", "C:\demo_logfile\Testlog"

    GetSetting App.Title, "HKEY_CURRENT_USER\MyTestKey", "Testlog", "C:\demo_logfile\Testlog"

    I have to write a script so I am not using Dialog box, i have to directly get the source and destination file path from registry..

    PLs Pls Help me ..its being long time I am doing this ....

    Pls provide solution ....

  • tejashree_lo Jun 24, 2009

    Thanks a lot :):)

    I will try this.

  • tejashree_lo Jun 29, 2009

    Hiii Again ,

    How can I have the VB 6.0 program wait until a shell command is finished????

    I am writing a function to zip a file and just below that I have written KILL command to delete the originol file. but its not waiting for the zip to finish and it is deleting the log file which i have to zip .

    Plzzzzz provide the solution

  • tejashree_lo Jun 29, 2009

    Can i use some API to know wether Zip file is created or not ???

    PLzzzzzz help me its very URGENT

  • tejashree_lo Jun 30, 2009


    My PM told me to find some WinZip API and want me to get something return when the file is zipped..I searched but i didnt find any API related to WinZip which perform the Zip..

    Plz reply.

    how can i directly mail u ??

  • tejashree_lo Jun 30, 2009

    Thanks a lot :)

    It was really helpful .

    instead of replying to the same mail how can i ask something directly to u ?



1 Answer

  • Level 3:

    An expert who has achieved level 3 by getting 1000 points


    An expert that got 10 achievements.


    An expert that got 5 achievements.

    Vice President:

    An expert whose answer got voted for 100 times.

  • Master
  • 428 Answers

Did u close the opened handle? after calculation?

Posted on Jun 22, 2009

  • 10 more comments 
  • Tharinda
    Tharinda Jun 22, 2009

    check whether the file is accessed by some part of ur program. if not go to the file and check properties to verify whether its read only or go to security tab and check whether u hv permission

  • Tharinda
    Tharinda Jun 22, 2009

    welll that's fine. Its an obvious thing :) have you tried to delete the file manually? Do it and see.
    If you don't have security tab in properties, get my computer and then go to Tools->Folder Options->view->Remove the tick for "Use simple file sharing(the very last option)"
    Then go to that tab and check whether your account is there with full permissions

  • Tharinda
    Tharinda Jun 22, 2009

    Open the file with full permission and then do your work. (if the handles are closed using Cose() on the stream objects...Don't open the file as read only.
    Try to delete the log file manually. Where did u create the file? Read only attribute is sometimes set to protect files. Its a normal thing. Specially for log files. You can create the file without the attribute using FileAttributes.Normal. But its fine to make it as read only coz its a log file.
    . I think you are using this namespace already
    I still think that there is a process which still locks your file.

  • Tharinda
    Tharinda Jun 22, 2009

    u need a script
    Go to this link
    I m in a hurry that's y I got late to reply you
    Please rate the answer

  • Tharinda
    Tharinda Jun 23, 2009

    ah that's easy I ll post it

  • Tharinda
    Tharinda Jun 23, 2009

    Saving Values In The Windows Registry

    SaveSetting appname, section, key, setting
    Here are the arguments for SaveSetting:
    • appname—String containing the name of the application to which the setting
    • section—String containing the name of the section where the key setting
    should be saved.
    • key—String containing the name of the key setting being saved.
    • setting—Expression containing the value to set the key to.

    Getting Values From The Windows Registry

    GetSetting( appname, section, key[, default])
    Here are the arguments passed to this function:
    • appname—String containing the name of the application or project whose key
    setting is requested.
    • section—String containing the name of the section where the key setting is
    • key—String containing the name of the key setting to return.
    • default—Expression containing the value to return if no value is

    Getting All Registry Settings
    You can use the GetAllSettings to get a list of key settings and their values from a section
    in the Windows Registry. Here’s how you use GetAllSettings:
    GetAllSettings( appname, section)
    Here are the arguments for GetAllSettings:
    • appname—String containing the name of the application whose key settings you
    • section—String containing the name of the section whose key settings you want.

    Deleting A Registry Setting
    You can delete Registry settings with the DeleteSetting statement:
    DeleteSetting appname, section[, key]


    Private Sub mnuOpen_Click()
    With dlgCommonDialog

    .DialogTitle = "Open"
    .CancelError = False
    .Filter = "All Files (*.*)[vbar]*.*"
    If Len(.FileName) = 0 Then
    Exit Sub
    End If
    If GetSetting(App.Title, "Settings", "Doc1") = "" Then
    Load mnuMRU(1)
    End If
    mnuMRU(1).Caption = .FileName
    mnuMRU(1).Visible = True
    SaveSetting App.Title, "Settings", "Doc1", .FileName
    End With
    End Sub

  • Tharinda
    Tharinda Jun 24, 2009

    Go here and see this will helpful to u
    Good Luck

  • Tharinda
    Tharinda Jun 24, 2009

    You are most welcome
    Its a pleasure to help you

  • Tharinda
    Tharinda Jun 29, 2009

    i see. ok I ll post

  • Tharinda
    Tharinda Jun 30, 2009

    I haven't used Winzip with VB projects but go here and have a look. There is working code at the bottom. I have used ZLIB once, go and check here also. Its easy to use. You can easily integrate those .dll s.
    If you want to wait until the Compression ends, you have to use a different function implementation which returns a value, to check whether the is finished.
    Hope this would help.

  • Tharinda
    Tharinda Jun 30, 2009

    I have found some very important API functions. You can do anything
    from these. I mean you can't write to here and there in the registry as
    u wish in vb without calling APIs. So here we go.

    Go here and check.

    And from here.


  • Tharinda
    Tharinda Jun 30, 2009

    :) I can't publicly give you the connection details, coz its prohibited na? For service providers its not allowed. Aap ko perm hain. Hum ko nahin :D . I know some hindi;)



1 Suggested Answer

  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi there,
Save hours of searching online or wasting money on unnecessary repairs by talking to a 6YA Expert who can help you resolve this issue over the phone in a minute or two.

Best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.

Here's a link to this great service

Good luck!

Posted on Jan 02, 2017


Add Your Answer

Uploading: 0%


Complete. Click "Add" to insert your video. Add



Related Questions:

1 Answer

Cannot get microfix usb digital microscope to work

That's probably a Windows privileges problem; only the administrator can write to the Program Files folder. Log in to the computer as administrator, open the MicroCapture program, find the settings for the file locations, and set up a folder in your (User Name) Documents for the MicroCapture files. Alternatively, modify the permissions for the MicroCapture folder (not recommended; do this only if MicroCapture won't let you use a different location).

Nov 30, 2014 | Computers & Internet

1 Answer

My computer retain this error and close application error code 3

I am also getting error code 3. I am able to transfer files using the exe. but running it from the scheduler/console I get:

permission denied
error code 3
error message from server permission denied.

why would I get that from the console and not from the ex
for more help visit CBR Tech Solutions

Apr 23, 2014 | Computers & Internet

1 Answer

I receive the error 'Network Initialization Failed: Permission Denied' when trying to launch Magicard ID software

Hi There,
This error happens when the user does not have read / write access to a file called PDOXUSRS.NET. Earlier versions of Magicard ID (before V3.02) stored this file on the root of the C: drive. If running on Windows Vista, the file cannot be accessed. The last version released (V3.05) in 2008 will run on Vista (32 bit only). If you are running V3.05 already, and still see this error, search for 'PDOXUSRS.NET'. It is probably in 'C:\Program Files\Magicard-ID\data'. Check the permissions on the file you must have read / write access to it. Try logging on as local admin. ensure any users who run Magicard ID have read / write permissions to this file. Magicard ID V3.05 can be found here;
NOTE! You will need to enter your printer's serial number in the QuickSearch box.

Hope this helps,


Sep 22, 2011 | Magicard Pro ID Badging Software Printer

1 Answer

WP Win Error message "access denied"

I think either the file and/or the directory are read-only. In the File Explorer, right clicking on the file will give you the properties including a box indicating if the file is read-only. A quick possibility is to save the file to a new location (with read/write permissions).

If you are the administrator of the computer (or the owner of the folder/file) you can change the status to allow for write privileges by changing that setting in the Properties.

I hope this helps.

Cindy Wells
(if you recently upgraded your OS or transferred the files from one computer to another, the file might not be "yours" to modify. I know that you can reset the permissions and change the owner but I don't remember the specifics. If you need more information, I can find my reference books if you tell me which OS you are using.)

Jan 19, 2010 | Corel WordPerfect Office X4 Home & Student...

1 Answer

Hitachi SimpleDrive 320GB: Error moving file: Access denied!

The problem may be that your Security settings for the drive are not configured to give you Full Control.

In Explorer, right-click on the Hitachi drive and choose Properties.
Go to the Security tab.

Find the User you are trying to use and click on it.
Under Permissions, click Edit and enable Full Control for that user.

That should give you the ability to do what you need to.

If Windows won't allow you to change the setting, it's because you don't have Administrator priviledges. In that case, log out and log back in as an Administrator and go back and make the changes.

Nov 04, 2009 | Computers & Internet

2 Answers

Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; Data Center; GTB6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648;...

The key part of the error message is "permission denied", so it is one of two things.
It is either exactly that, you need to log into the server and set the permissions to "Read, Write, Execute" in the everybody group, OR there is something on that line of code that the browser security finds unsafe. You can test that out by setting your security real low for just a moment to try again, if you are sure it is safe to do so.

Sep 19, 2009 | Computers & Internet

3 Answers

Windows event log service wont start, error code 5

Your right its not a virus, and its not because your running one of the top anti- virus software,the problem is else where.
Have you checked the log files to see if you have permission?????
Have you checked event viewer to see if you have permission????

I need to know or the fix I have for you will not work.

Mar 13, 2009 | Dell Inspiron 530 Desktop Computer

1 Answer

Mac Error

Hi Joe
Sound like a permissions problem.

Make sure you have admin rights on your log in or log in as admin. Check the permissions on the application folder, that you have read and write (single click on the folder press option and 'i' key to get folder info.

With Macromedia it installs folders in quite a few locations so you need to make sure you have 'read/write' permission on the whole mac.

If you still have a problem. Open the apple disk utility (in the utility folder in applications) and check permissions there. You can run fix permissions from the to.


Sep 07, 2008 | Apple Mac OS X 10.4

1 Answer

Saying "Access Denied" while Installing the CD


Your brief description could mean:
1. you have no permission to install a printer, meaning you have no administrative rights to do so, pls logoff and log back in as an administrator;
2. you are using a registry lock program (such as Ad-Watch) that prevents access/writing to the registry or adding anything to the system files;
3. the CD ROM is not reading the installer CD.

Hope this be of initial help/idea. Pls post back how things turned up or should you need additional information.

Good luck and kind regards.

Thank you for using FixYa.

Feb 18, 2008 | HP Deskjet D4260 Printer

Not finding what you are looking for?
Microsoft Visual Basic 6.0 (361-00686) for PC Logo

Related Topics:

1,178 people viewed this question

Ask a Question

Usually answered in minutes!

Top Microsoft Computers & Internet Experts

micky dee

Level 3 Expert

3015 Answers

Les Dickinson
Les Dickinson

Level 3 Expert

18425 Answers

Alun Cox

Level 3 Expert

2678 Answers

Are you a Microsoft Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides