Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > Registry/Run problem with .bat file.

Reply
Thread Tools Display Modes

Registry/Run problem with .bat file.

 
 
Mobz
Guest
Posts: n/a

 
      10-10-2009

I`m having some problems with an automatic application/updates installe
script.

I have 3 different bat files, the 1st one containing differen
applications to install without user interruption, works fine. And th
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 wan
them to do

Problem:
That i have to be there when the computer restarts after bat1 to star
bat2 and finally to start bat 3. (Ive written a script in the first ba
file that turns off the UAC prompt, and then when almost finished wit
the 3rd one turns it on again).

Solution (I tought):
Would be to write to the registry run command and then when its don
delete the entries in registry. And that works fine.
Code (example):
-set var=%~dp0
REG ADD HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\ru
/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, an
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 command
ive given it.
But it doesnt run from the G:\BAT2.bat> *all commands*. It starts th
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 a
its supposed to.
Its like when it starts from the run in registry, its just call the ba
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 i
starts to drive me crazy. (Sorry for my bad english im from Sweden).

Very very much thanks in advance.

/Mob

--
Mobz
 
Reply With Quote
 
 
 
 
lemur
Guest
Posts: n/a

 
      10-10-2009

please don't cross post. thank you

--
lemu

::If *ANYONE* in this forum helps you, please click o
their *REP* icon. Thanks! (the middle scale icon in the upper righ
corner)::
 
Reply With Quote
 
Gene E. Bloch
Guest
Posts: n/a

 
      10-10-2009
On Fri, 9 Oct 2009 19:41:46 -0500, lemur wrote:

> please don't cross post. thank you.


1. The original post is posted to only one newsgroup, namely
microsoft.public.windows.vista.general. Look at the headers.

2. What's wrong with cross-posting? It's done all the time when two or
three groups are appropriate to the subject, although posting to more
newsgroups than that is often deprecated.

3. Many newsreaders let you suppress posts that are cross-posted to more
than n groups, where n is your choice. Maybe you should think of getting
one of those so you could read newsgroups in situ instead of via vBulletin
USENET gateway (whatever that might be, it seems not to be a real
newsreader). Then you'd be in charge of your own experience, and you
wouldn't have to give orders to strangers.

--
Gene E. Bloch letters0x40blochg0x2Ecom
 
Reply With Quote
 
Tae Song
Guest
Posts: n/a

 
      10-10-2009

"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.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Primary and Secondary IDE Channel Giuseppe Windows 64 Bit 7 04-24-2007 10:44 PM
Sharepoint, monitoring and the company web Susan123456 Windows Small Business Server 21 11-23-2005 07:30 AM
SBS2003 Exchange Backup Problems (& musings) Macker Windows Small Business Server 9 04-19-2005 12:36 AM
backup error steven Windows Small Business Server 7 01-03-2005 01:40 AM
no updates were installed in windows 2003 aj Windows Small Business Server 5 08-04-2004 09:03 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59