ewilliams

Create .bat file to run after windows install

19 posts in this topic

I own a small computer repair shop and am trying to make a .bat file run directly after the installation of windows is finished. I will need it for windows 7 and xp. Here is my .bat file

Set RegQry=HKLM\Hardware\Description\System\CentralProcessor\0
REG.exe Query %RegQry% | Find /i "x86"
If %ERRORLEVEL% == 0 (
GOTO X86
) ELSE (
GOTO X64
)


:X86

@echo off
REG ADD "HKCU\SOFTWARE\MICROSOFT\INTERNET EXPLORER\MAIN" /V "START PAGE" /D "http://facebook.com/pcmscomputers" /F
start iexplore http://facebook.com/pcmscomputers
"1 MSE Win 7 - 32.exe"
"Flash 32.exe"
"2 Drivers.exe"

GOTO END

:X64

@echo off
REG ADD "HKCU\SOFTWARE\MICROSOFT\INTERNET EXPLORER\MAIN" /V "START PAGE" /D "http://facebook.com/pcmscomputers" /F
start iexplore http://facebook.com/pcmscomputers
"1 MSE Win 7 - 64.exe"
"Flash 64.exe"
"2 Drivers.exe"

:End

Edited by Tripredacus
0

Share this post


Link to post
Share on other sites

If I may, simpler ;):

@echo off

SET Bits=64

Set RegQry=HKLM\Hardware\Description\System\CentralProcessor\0

REG.exe Query %RegQry% | Find /i "x86"

If %ERRORLEVEL% == 0 SET Bits=32

REG ADD "HKCU\SOFTWARE\MICROSOFT\INTERNET EXPLORER\MAIN" /V "START PAGE" /D "http://facebook.com/pcmscomputers"'>http://facebook.com/pcmscomputers" /F

start iexplore http://facebook.com/pcmscomputers

"1 MSE Win 7 - %Bits%.exe"

"Flash %Bits%.exe"

"2 Drivers.exe"

But what was the actual question? :unsure:

jaclaz

0

Share this post


Link to post
Share on other sites

I am trying to make that .bat file automatically run directly after finishing the windows installation

0

Share this post


Link to post
Share on other sites

I am trying to make that .bat file automatically run directly after finishing the windows installation

You can put that bat file or its shortcut in the startup folder, it will run automatically on first logon.

0

Share this post


Link to post
Share on other sites

I know I could do that but I am trying to not have to click on it or anything. If I add it to the start menu I would be better off just clicking to start it then waiting for it to restart.

0

Share this post


Link to post
Share on other sites

I am trying to make that .bat file automatically run directly after finishing the windows installation

You can put that bat file or its shortcut in the startup folder, it will run automatically on first logon.

I know I can do that. But then I would have to restart the computer. I would be better off just clicking on the .bat file. I am trying to do it like in the Setupcomplete.cmd or something to that nature

0

Share this post


Link to post
Share on other sites

Although you are likely installing 64-bit onto every unit with a 64-bit CPU, I would suggest that you check the 'bitness' of the Operating System not that of the Hardware.

Using a 'batch file', (your request), you can probably do this with WMIC.

The following three lines could replace the first five lines previously provided by jaclaz

@ECHO OFF&SETLOCAL
SET "Bits=32"
WMIC OS GET OSARCHITECTURE|FIND "64">NUL&&SET "Bits=64"

Off Topic, I think that you are very wrong opening someone's Internet Explorer browser without them having had the opportunity to configure or update/patch it first.

0

Share this post


Link to post
Share on other sites

Although you are likely installing 64-bit onto every unit with a 64-bit CPU, I would suggest that you check the 'bitness' of the Operating System not that of the Hardware.

Using a 'batch file', (your request), you can probably do this with WMIC.

The following three lines could replace the first five lines previously provided by jaclaz

@ECHO OFF&SETLOCAL
SET "Bits=32"
WMIC OS GET OSARCHITECTURE|FIND "64">NUL&&SET "Bits=64"

Off Topic, I think that you are very wrong opening someone's Internet Explorer browser without them having had the opportunity to configure or update/patch it first.

I am opening it going to only that page just to make sure everything is functioning correctly

But still can anyone help me?????????????

0

Share this post


Link to post
Share on other sites
I am opening it going to only that page just to make sure everything is functioning correctly

All you are doing is forcing a specific web page with a specific browser, that really isn't an test of the effectiveness/stability of your installation onto their hardware. Apart from that, I'm not naive, If you were simply checking functionality on a one time only basis why have you set it as their start page too?

Additionally, I see no reason to force flashplayer and MSE on every customer either, (if someone requires flash they will be given the opportunity to install it from most sites using it, and MSE is not everyone's choice, only yours, some may prefer a full security suite or free products from companies like BitDefender or AVIRA.

BTW, if you wish to receive a response to your question, you'd be more likely to get your wish if you provided a reasonably detailed explanation on which method(s) of installation you are using with each specific Operating System.

0

Share this post


Link to post
Share on other sites
I am opening it going to only that page just to make sure everything is functioning correctly

All you are doing is forcing a specific web page with a specific browser, that really isn't an test of the effectiveness/stability of your installation onto their hardware. Apart from that, I'm not naive, If you were simply checking functionality on a one time only basis why have you set it as their start page too?

Additionally, I see no reason to force flashplayer and MSE on every customer either, (if someone requires flash they will be given the opportunity to install it from most sites using it, and MSE is not everyone's choice, only yours, some may prefer a full security suite or free products from companies like BitDefender or AVIRA.

BTW, if you wish to receive a response to your question, you'd be more likely to get your wish if you provided a reasonably detailed explanation on which method(s) of installation you are using with each specific Operating System.

Most of my customers are around 50 years old and just want antivirus I set the homepage to my company facebook just so they can get updates they are free to change anything they wish. I just do that by default. I use a new windows installation and key for each install.

0

Share this post


Link to post
Share on other sites

Yzöwl good grief

nothing wrong with that every dang OEM on this earth plants a bunch of garbage pointing to their websites. I've been in all of them.

Adding MSE is better than all the other garbage OEM do, 60 day trial's

XP is a little old and uses stuff unlike Win 7. With 7 you can add an xml and even add your webpage to it. You would want to call the bat in OOBEsystem most likely since mse can't install silently you must have it up and running and click through the dialogues. Examples here

Read this earlier but was working on something else and would have to think of best way in XP

0

Share this post


Link to post
Share on other sites

Yzöwl good grief

nothing wrong with that every dang OEM on this earth plants a bunch of garbage pointing to their websites. I've been in all of them.

Adding MSE is better than all the other garbage OEM do, 60 day trial's

XP is a little old and uses stuff unlike Win 7. With 7 you can add an xml and even add your webpage to it. You would want to call the bat in OOBEsystem most likely since mse can't install silently you must have it up and running and click through the dialogues. Examples here

Read this earlier but was working on something else and would have to think of best way in XP

Huh?, ofcouse you can install MSE silently.

0

Share this post


Link to post
Share on other sites

yep forgot about the /s /runwgacheck. I generally run through it to set my settings like scan daily and time since reg key has permissions on it

Edited by maxXPsoft
0

Share this post


Link to post
Share on other sites

Yzöwl good grief

nothing wrong with that every dang OEM on this earth plants a bunch of garbage pointing to their websites. I've been in all of them.

Adding MSE is better than all the other garbage OEM do, 60 day trial's

Of course there's something wrong with that; my issue isn't with sending someone to your website, it's with forcing it on first installation using a specific browser. Also if your doing this at your workplace you're likely connecting through a wired network, not the customers network. (so you are effectively testing the functioning in an environment under which it will not be used). If you are installing it at the customers premises then it is unlikely to work since their, usually wireless, network has not yet been configured.

The prudent thing to do if your happy to force stuff on your customer like this would be to have this run once when they receive the PC and have set it up to their liking, and use a URL which is not linked to a specific browser.

On the issue of software installation I'm afraid I'll never agree with condoning this practice. It is rude to force a particular piece of software onto someone else's machine, you should at least give them an on screen choice, the same way Microsoft had to with browsers.

That said, the entire thought process here needs looking at. If I install a 64-bit Operating System onto a PC I'll already know that this will in turn involve installing 64-bit software where available; I certainly wouldn't need a batch file to work that out for me. I see no real benefit in creating a single installation media which installs both 32 and 64-bit and which is only as up to date as the versions of software integrated.

0

Share this post


Link to post
Share on other sites

Ok it is not on customer machines it is on computers I am selling but thanks for everything I will try to find help elsewhere

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.