MSFN Forum: simple batch file question from a newbie - MSFN Forum

Jump to content


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

simple batch file question from a newbie Rate Topic: -----

#1 User is offline   THXMAN 

  • Newbie
  • Group: Members
  • Posts: 30
  • Joined: 09-March 09

Posted 19 August 2012 - 05:41 AM

I have one question regarding batch files with WPI.

Here is my scenario

1. I have the WPI folder on a USB stick
2. I have an batch file i want to run called oem.bat

oem.bat contains these commands. but they do not get excecuted. by the WPI menu. but if i run the batch file my self i works fine.
What me batch file does

@echo off
copy OEMLogo.bmp %windir%\system32
regedit /s OEMinfo.reg

------------------------------------------------------------------------------

command from JS

prog[pn]=['OEM Logo Labtech - support oplysninger'];
uid[pn]=['OEMLOGOLABTECH'];
dflt[pn]=['yes'];
forc[pn]=['no'];
bit64[pn]=['no'];
cat[pn]=['Applications'];
pfro[pn]=['no'];
cmds[pn]=['{BATCH} "%wpipath%\\install\\oemlogo\\oem.bat"',''];
desc[pn]=['OEM Logo Labtech'];
pn++;


.
Kind Regards THXMAN


#2 User is offline   myselfidem 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,393
  • Joined: 06-January 10
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 19 August 2012 - 05:46 AM

Try to give the full path inside your oem.bat file (where are located OEMLogo.bmp and OEMinfo.reg)

for OEMLogo.bmp and using regedit /s


*Edit: Check also the quotes: (double quotes at last)
Your example corrected:

Quote

cmds[pn]=['{BATCH} "%wpipath%\\install\\oemlogo\\oem.bat"'];

This post has been edited by myselfidem: 19 August 2012 - 12:42 PM


#3 User is offline   THXMAN 

  • Newbie
  • Group: Members
  • Posts: 30
  • Joined: 09-March 09

Posted 19 August 2012 - 02:42 PM

my files OEMLogo.bmp and OEMinfo.reg are located in "WPI\install\oemlogo" folder same place as the oem.bat

and i have my WIndows and WPI running from a USB stick
WPI folder is in the root of the usb stick

i did fix (double quotes at last) thank you :)

can you tell me the full path command line i should use inside the oem.bat file


@echo off
copy OEMLogo.bmp %windir%\system32
regedit /s OEMinfo.reg

Kind regards THXMAN

#4 User is offline   myselfidem 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,393
  • Joined: 06-January 10
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 19 August 2012 - 03:07 PM

Maybe you can try to use the oem.bat like this using {BATCH} with WPI:

oem.bat

@ECHO OFF

COPY /Y "%wpipath%\Install\oemlogo\OEMLogo.bmp" "%windir%\System32\" 
REGEDIT /S "%wpipath%\Install\oemlogo\OEMinfo.reg"

EXIT





#5 User is offline   THXMAN 

  • Newbie
  • Group: Members
  • Posts: 30
  • Joined: 09-March 09

Posted 19 August 2012 - 03:16 PM

Thanks you so much, work great.

i got i learn more about command :)

#6 User is offline   myselfidem 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,393
  • Joined: 06-January 10
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 19 August 2012 - 03:21 PM

:yes: Enjoy!

#7 User is offline   THXMAN 

  • Newbie
  • Group: Members
  • Posts: 30
  • Joined: 09-March 09

Posted 19 August 2012 - 05:47 PM

One last thing, what command should i use to start wpi\wpi.exe from the usb stick.

because this here does not work, i run it from $oem$\$$\setup\scripts\setupcomplete.cmd

@echo off

for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\sources\install.wim set root=%%i:

Start %root%\WPI\wpi.exe

rem del %0

Kind regards THXMAN

#8 User is online   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,325
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 19 August 2012 - 07:20 PM

Have you checked the manual and website? There is a provided solution

#9 User is offline   myselfidem 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,393
  • Joined: 06-January 10
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 21 August 2012 - 12:59 AM

http://www.msfn.org/...ost__p__1001605

http://www.msfn.org/...ost__p__1007463

This post has been edited by myselfidem: 09 September 2012 - 02:59 AM


#10 User is offline   stsaerox 

  • Newbie
  • Group: Members
  • Posts: 48
  • Joined: 09-January 09

Posted 03 October 2012 - 05:13 AM

I'm trying for a long time now to run a batch file:
@echo off

echo Installing Java
for %%a in (*.exe) do "%%a" /s


with this command typed in wpi:
{BATCH} "%wpipath%\Install\WinExt\Java\Run.bat"


It fails instantly.

Well if this command work somehow it will be a great progress in updating the unattended installation executable because I have to replace only with the newer executable and not change the commands for each file. This method if work saves time updating.

#11 User is offline   myselfidem 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,393
  • Joined: 06-January 10
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 03 October 2012 - 11:11 AM

The trouble is with your batch file!
Check the paths.

#12 User is offline   stsaerox 

  • Newbie
  • Group: Members
  • Posts: 48
  • Joined: 09-January 09

Posted 03 October 2012 - 05:31 PM

Is it really? I cannot figure out my mistake.
This is how I select the path so I won't make a mistake with paths:



if you mean the path IN the batch file I have no idea how to fix this but if double click it runs and installs ok.
My full path there is "E:\Programs\Install\Projects\WPI ALL\WPI\Install\WinExt\Java" In java is bat and exe file.
I'm just building this in there if use it I will move it to a flash memory stick.

Edit: Can you see my video in this post? I cannot see that. If no please try this.
Windows post install - cannot run batch with "for" and ''do" commands.

oh what is happening? third edit and no video at all....

This post has been edited by stsaerox: 03 October 2012 - 05:35 PM


#13 User is offline   myselfidem 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,393
  • Joined: 06-January 10
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 04 October 2012 - 02:12 AM

I can see your video on this link:

http://www.youtube.com/watch?v=FfT6h7G0jyc&feature=youtu.be


*Edit: could you attach your config.js file, please?

This post has been edited by myselfidem: 04 October 2012 - 04:04 AM


#14 User is offline   stsaerox 

  • Newbie
  • Group: Members
  • Posts: 48
  • Joined: 09-January 09

Posted 04 October 2012 - 04:05 AM

Yes this is it. Can you help me with this? I've tried in many different ways but it keeps failing instantly...

Edit: Here it is: Attached File  config.js (66.43K)
Number of downloads: 4

This post has been edited by stsaerox: 04 October 2012 - 04:20 AM


#15 User is online   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,325
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 04 October 2012 - 04:13 AM

{BATCH} "%wpipath%\Install\WinExt\Java\Run.bat"


Is this ^ EXACTLY copied from your WPI???

When I watch the video I see this:

{BATCH}"%wpipath%\Install\WinExt\Java\Run.bat" < --- No space...

#16 User is offline   stsaerox 

  • Newbie
  • Group: Members
  • Posts: 48
  • Joined: 09-January 09

Posted 04 October 2012 - 04:26 AM

I've tried both ways if you mean between {BATCH} and the rest. With space or not.

Forgot to mention that wpi version is 8.1.0. Last time I've failed to move correctly config files in the newer version and it was not working. Anyway if I solve this now this will be an easy task.

#17 User is offline   myselfidem 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,393
  • Joined: 06-January 10
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 04 October 2012 - 04:30 AM

Tested like this and works fine for me:

Run.bat
@echo off
echo Installing Java
for %%a in (%wpipath%\Install\JAVA\*.exe) do "%%a" /s



Run.bat and jre-7u4-windows-i586.exe are inside the same folder JAVA

This post has been edited by myselfidem: 04 October 2012 - 04:31 AM


#18 User is offline   stsaerox 

  • Newbie
  • Group: Members
  • Posts: 48
  • Joined: 09-January 09

Posted 04 October 2012 - 04:36 AM

It keeps failing for me maybe something is wrong with my wpi now. I'll try to make a new one and run the batch.

Edit: In the latest (8.6.2) It seems ok, I get success message.

Edit: At first I had some path mistakes and It didn't work but now it is ok. Thanks myselfidem. I 've read many times about commands but when I combine them I get confused.

This is awesome for me, now wpi will be my right had. I help many friends with windows installation because services there are no good and expensive.

And there is great effort made to the latest wpi.... thank you.

This post has been edited by stsaerox: 04 October 2012 - 05:10 AM


#19 User is offline   myselfidem 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,393
  • Joined: 06-January 10
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 04 October 2012 - 05:16 AM

Enjoy! ;)

#20 User is offline   stsaerox 

  • Newbie
  • Group: Members
  • Posts: 48
  • Joined: 09-January 09

Posted 20 October 2012 - 08:31 AM

View Postmyselfidem, on 04 October 2012 - 04:30 AM, said:

Tested like this and works fine for me:

Run.bat
@echo off
echo Installing Java
for %%a in (%wpipath%\Install\JAVA\*.exe) do "%%a" /s



Run.bat and jre-7u4-windows-i586.exe are inside the same folder JAVA



If I run a command like this and wpi is not at the root of the drive it fails. Is it the way that just wpi works or I've done something wrong?
(I'm asking this because in every suggested path in help files I've read, wpi folder is at the root of a drive)

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy