Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Create .bat file to run after windows install


  • Please log in to reply
18 replies to this topic

#1
ewilliams

ewilliams
  • Member
  • 7 posts
  • Joined 04-May 12
  • OS:Windows 7 x64
  • Country: Country Flag
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, 07 May 2012 - 08:17 AM.



How to remove advertisement from MSFN

#2
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,773 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag
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" /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

#3
ewilliams

ewilliams
  • Member
  • 7 posts
  • Joined 04-May 12
  • OS:Windows 7 x64
  • Country: Country Flag
I am trying to make that .bat file automatically run directly after finishing the windows installation

#4
nice_guy75

nice_guy75

    Advanced Member

  • Member
  • PipPipPip
  • 403 posts
  • Joined 07-December 09

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.

#5
ewilliams

ewilliams
  • Member
  • 7 posts
  • Joined 04-May 12
  • OS:Windows 7 x64
  • Country: Country Flag
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.

#6
ewilliams

ewilliams
  • Member
  • 7 posts
  • Joined 04-May 12
  • OS:Windows 7 x64
  • Country: Country Flag

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

#7
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,078 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

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.

#8
ewilliams

ewilliams
  • Member
  • 7 posts
  • Joined 04-May 12
  • OS:Windows 7 x64
  • Country: Country Flag

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?????????????

#9
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,078 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

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.

#10
ewilliams

ewilliams
  • Member
  • 7 posts
  • Joined 04-May 12
  • OS:Windows 7 x64
  • Country: Country Flag

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.

#11
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,879 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag
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 http://www.msfn.org/...seven-xml-here/

Read this earlier but was working on something else and would have to think of best way in XP
Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1

#12
wazer

wazer

    You gotta risk it to get the biscuits

  • Member
  • PipPip
  • 234 posts
  • Joined 24-May 05
  • OS:Windows 8.1 x64
  • Country: Country Flag

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 http://www.msfn.org/...seven-xml-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.
if ( $life( $me ) == $null ) { getLife( $me ) | halt }


Quick Launch Classic 7 Tool

#13
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,879 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag
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, 06 May 2012 - 05:46 AM.

Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1

#14
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,078 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

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.

#15
ewilliams

ewilliams
  • Member
  • 7 posts
  • Joined 04-May 12
  • OS:Windows 7 x64
  • Country: Country Flag
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

#16
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,078 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

Well you are free of course to do that, however I'd suggest that if you venture elsewhere for a solution you'd be advised to:
  • Answer questions posed.
    which as yet you've failed to do here.
  • Tell the truth!
    which you've admitted failing to do here.
We are not going to provide you with every possible answer in the hope that one will suit you and your situation. It is your responsibility to provide sufficient information in order that we can tailor responses to suit, (otherwise we could just tell you to read the guides and forum since your solution is most definitely among them).

#17
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,879 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag
You feelin bad or something Yzöwl cause I didn't see none of that in his things.
He just repairs and builds PC's as I only do part time and they are generally XP or Win 7
He just trying to automate things a little.

People get their selves in trouble and if I have to I format and reinstall and generally I will install a free MSE cause it simply works on both and I know what to tell them if they call. They want to change it they more than welcome and I'll help them best I can with what they prefer but most PC user's don't understand Anykey. 40% of them will ask me to tell them how to change their startup to Facebook since it's going thing or either they know how. The rest don't care

I used to install Firefox on them and recommend they use that over IE because it's safer but 90% won't. They want to use what they know here in the US (IE) and feel ok with I guess. I use Maxthon now
Installing Flash is a no brainer, most the short movies are flash like on youtube and instead of waisting time walking some of these people through that I install it also for each browser i put in.
I'll also put on Adobe Reader so they can read the pdf's and I don't waste my time telling them what to do if they have to install it.

IMHO: These forums are bare these day's and sending people off is not a good thing
And only IE I save this whole page to .mht, such a good thing. Only browser will

@wazer
I finally worked out my SetACL where I can change the settings in the protected registry key's so now I can install silent and run it and set the key's back to where they should be.
SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
REG ADD %KEY% /V TITLE /D "RunOnceEx - Testing Applications" /f
REG ADD %KEY% /v Flags /t REG_DWORD /d "20" /f

REG ADD %KEY%\1001 /VE /D "Microsoft Security Essentials x64" /f
REG ADD %KEY%\1001 /V 101 /D "CMD /C Start /Wait D:\APPS\MS_SecurityEssentials_x64\mseinstall.exe /s /runwgacheck" /f
REG ADD %KEY%\1001 /V 102 /D "CMD /C Start /Wait D:\APPS\MS_SecurityEssentials_x64\SecurityEssentials64.cmd" /f

Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1

#18
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,078 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

You feelin bad or something Yzöwl cause I didn't see none of that in his things.

I'm not interested in your reasoning behind installing rubbish software onto other peoples machines, suffice it to say that I will never agree to it. (most of my PC work has been based around removing unwanted pre-installed software and viruses from OEM's ill chosen anti-malware solutions).

That however is only a minor irritation, there are two main issues here:
  • The OP has provided no information whatsoever on which method they are using for installing Windows XP or for installing Windows 7 onto these machines for 50 year olds.
    (both completely different and only one of which is covered in this particular forum area)
  • The batch file they are requesting help with indicates a poorly thought out system. Why go to the lengths of creating a single media which deploys both 64-bit and 32-bit. This means relying on the batch to make the software installation determination for you and having to manually rename a bunch of files so that each can be identified by the batch according to the bitness.
    (when you create installation media, there is no real benefit in integrating both 32-bit and 64-bit on that same media. It is extra work just to save on the cost of another blank DVD. You create 32-bit OS installation media complete with 32-bit software installations, (if you're happy to do this very frequently), then replicate the process with the 64-bit OS and 64-bit software. (Even Microsoft provide a separate disk for each).

People need to be mindful not to fall into the trap of spending more time creating and updating media than the time saved by using it!

<Edit />
I also notice that not once has the OP thanked any single contributor to this Topic for the pertinent responses they provided.

Edited by Yzöwl, 07 May 2012 - 06:44 AM.
See <Edit />


#19
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 10,097 posts
  • Joined 28-April 06
  • OS:Windows 7 x86
  • Country: Country Flag

Donator

I'll just leave a note in here about Flash player... If you are installing Flash player on computers for sale or resale, and are operating as a business, you need to get a redist agreement from Adobe. I run into clients trying this all the time without said agreement.
http://www.adobe.com...stribution.html

Its a CYA thing. ;)

MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users