Running a batch file in vista using option to run as administrator

burnbaby200

Running a batch file in vista using option to run as administrator

by burnbaby200 » Mon, 06 Aug 2007 11:46:35

I have this simple batch file in my application folder that I run to unregister and register all dlls and ocxs. When I run it from explorer in XP it works fine and only unregister/register stuff in that folder, but if I do the same thing in Vista in explorer and right-click on batch file and choose option to run as administrator it starts to unregister everything in my windows\system32 folder not the folder that the batch file is in.

Anyone know how to fix this

Thanks

This is the contents of the batch file:

for %%1 in (*.dll) do regsvr32 /u /s %%1
for %%1 in (*.ocx) do regsvr32 /u /s %%1
for %%1 in (*.dll) do regsvr32 /s %%1
for %%1 in (*.ocx) do regsvr32 /s %%1



Bruce N. Baker - MSF

Running a batch file in vista using option to run as administrator

by Bruce N. Baker - MSF » Wed, 08 Aug 2007 12:47:36

Batch reg and unreg is probably not the best way to manage this but it would be smart to path exactly the location that you want to perform the every reg at. Is the %%1 getting to your batch file, I'm assuming the arg is put into your link as an argument, also assuming you have created a link. Do you have the start in value set properly Check all the link properties.



burnbaby200

Running a batch file in vista using option to run as administrator

by burnbaby200 » Fri, 10 Aug 2007 13:48:37

Thanks that did the track to add the path and also the start in was not set so either method solves the problem.

Thanks again.