running batch file before files are locked

D

david

I have software that's loaded by my company when I use my personal
computer to go onto our intranet. I don't want this software on my
personal machine and, so, want to write a batch file to delete it
whenever I boot.

Unfortunately, files within the to-be-deleted directory get locked by
various processes. Is there a way I can run the batch process
automatically before anything gets locked during startup?

Thanks,
David
 
W

Wesley Vogel

Place a shortcut to your *.bat or *.cmd file in...
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run

I have a batch file that runs from there and deletes several
index.dat files before they get locked.

Open the Registry Editor...
Start | Run | Type: regedit | Click OK |
Navigate to >>
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run

Right click in the right hand pane, point to New and select String Value |
Name it whatever | Double click the new entry and type or paste the path to
the *.bat or *.cmd file | Click OK | Close regedit | Reboot and see if it
runs

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
D

david

I created the new 'String value'. I now have an entry 'New Value #1'
include that cannot be renamed, modified, or deleted.

When deleting, system reports that 'Unable to delete all specified
values'
When renaming, system reports that regedit 'cannot rename New Value #1.
Error while renaming value.'
When modifying, system reports 'Cannot edit New Value #1: Error reading
the value's contents.'

Please help!

Also, I notice a couple of entries that are no longer needed (HP
obviously didn't clean things up as well as they could). Would there be
any problem just deleting these?

Thanks,
David
 
W

Wesley Vogel

David,

Sounds like a permission problem. You are an Administrator?

Try this...
Reset the registry permissions

Open the Registry Editor...
Start | Run | Type: regedit | Click OK |
Navigate to >>
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
Right click on the Run folder and then click Permissions.
Under Group or user names, click Administrators.
Under Permissions for Administrators, make sure that the Allow check box
for the following entries is selected:
• Full Control
• Read
Click Apply and then click OK.
On the File menu, click Exit to quit Registry Editor.

Open the Registry Editor again and see if you can modify the values now.

If not, try this...
Start | Run | Type: regedit | OK |
Navigate to >>>
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
Right click the key in the left hand pane | Permissions... | Advanced
button | Owner tab | click the new owner and then click OK.
-----

To assign permissions to a registry key
http://www.microsoft.com/resources/...xp/all/proddocs/en-us/regedit_permit_key.mspx

To assign special access to a registry key
http://www.microsoft.com/resources/...ll/proddocs/en-us/regedit_assign_specacc.mspx

To grant Full Control of a registry key
http://www.microsoft.com/resources/.../xp/all/proddocs/en-us/regedit_yield_own.mspx

To add users or groups to the audit list
http://www.microsoft.com/resources/...proddocs/en-us/regedit_audit_key_adduser.mspx

To add users or groups to the Permissions list
http://www.microsoft.com/resources/...roddocs/en-us/regedit_permit_key_adduser.mspx

To remove a user or group from the Permissions list
http://www.microsoft.com/resources/...proddocs/en-us/regedit_permit_key_remove.mspx

To take ownership of a registry key
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/regedit_take_own.mspx

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
D

david

Yes, I'm an administrator. I did go in and change owner to the myself
and continue to experience the same problem. Please advise.

TIA,
David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top