"Mobz" <> wrote in message
news:...
>
> I`m having some problems with an automatic application/updates installer
> script.
>
> I have 3 different bat files, the 1st one containing different
> applications to install without user interruption, works fine. And the
> 2nd bat file containing Service Pack 2 installation, unattended install.
> And finally the 3rd bat file installs different windows update files,
> also unattended. And they all works perfectly fine, exactly as i want
> them to do
>
> Problem:
> That i have to be there when the computer restarts after bat1 to start
> bat2 and finally to start bat 3. (Ive written a script in the first bat
> file that turns off the UAC prompt, and then when almost finished with
> the 3rd one turns it on again).
>
> Solution (I tought):
> Would be to write to the registry run command and then when its done
> delete the entries in registry. And that works fine.
> Code (example):
> -set var=%~dp0
> REG ADD HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\run
> /v Testauto /t REG_SZ /d %var%BAT2.bat
> shutdown /r /f /t 05-
>
> Why i have "-set var=%~dp0-" is because its stored on a usb stick, and
> that it will be given different drive paths on different computers.
>
> Register entry:
> Data name:Testauto Datavalue: G:\BAT2.bat
> And everything looks good, exactly as i want.
>
> Unsolved problem:
> When my computer restarts it starts the BAT2.bat with all the commands
> ive given it.
> But it doesnt run from the G:\BAT2.bat> *all commands*. It starts the
> commands from C:\windows\system32 >BAT2.bat>*all commands*. Why???
> If i for example open the run box, and type:G:\BAT2.bat it starts as
> its supposed to.
> Its like when it starts from the run in registry, its just call the bat
> file from cmd.exe.
> And in registry it all looks as its supposed to.
>
> Please tell me someone has a solution for this problem, because it
> starts to drive me crazy. (Sorry for my bad english im from Sweden).
>
> Very very much thanks in advance.
>
> /Mobz
>
>
> --
> Mobz
Be honest, did you lift this code from somewhere and tried to modify it?
The error is glaringly obvious.
|