Tech Support > Microsoft Windows > running batch file before files are locked
running batch file before files are locked
Posted by david@drschwartz.net on January 26th, 2006


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

Posted by Wesley Vogel on January 26th, 2006


Place a shortcut to your *.bat or *.cmd file in...
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Curr entVersion\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\Curr entVersion\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 news:1138294892.179272.221510@g49g2000cwa.googlegr oups.com,
david@drschwartz.net <david@drschwartz.net> hunted and pecked:

Posted by david@drschwartz.net on January 27th, 2006


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

Posted by Wesley Vogel on January 28th, 2006


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\Curr entVersion\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\Curr entVersion\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/d...ermit_key.mspx

To assign special access to a registry key
http://www.microsoft.com/resources/d...n_specacc.mspx

To grant Full Control of a registry key
http://www.microsoft.com/resources/d...yield_own.mspx

To add users or groups to the audit list
http://www.microsoft.com/resources/d...y_adduser.mspx

To add users or groups to the Permissions list
http://www.microsoft.com/resources/d...y_adduser.mspx

To remove a user or group from the Permissions list
http://www.microsoft.com/resources/d...ey_remove.mspx

To take ownership of a registry key
http://www.microsoft.com/resources/d..._take_own.mspx

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In news:1138402767.673161.167390@f14g2000cwb.googlegr oups.com,
david@drschwartz.net <david@drschwartz.net> hunted and pecked:

Posted by david@drschwartz.net on January 31st, 2006


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


Similar Posts