Jump to content











Photo
- - - - -

How to start a progarm after "VistaPE Loader"


  • Please log in to reply
14 replies to this topic

#1 DanTang

DanTang

    Newbie

  • Members
  • 23 posts
  •  
    Australia

Posted 29 June 2009 - 03:42 PM

I wants to run a program on start up that depends on the network drive been loaded and TCP/IP protocol up and running, how can I do that?
Is there anyway to detect if the TCP/IP is up and running before doing the further scanning extra drivers, I would like to pack a small pack of common drivers together, so they will be scanned first, if the TCP/IP is not running, then all other driver will be processed!

That will cut down a lot of wait time for technician, thanks in advance!

#2 JonF

JonF

    Gold Member

  • .script developer
  • 1185 posts
  • Location:Boston, MA
  •  
    United States

Posted 29 June 2009 - 04:12 PM

You can set up a loop that runs as long as "ping google.com" fails.

#3 DanTang

DanTang

    Newbie

  • Members
  • 23 posts
  •  
    Australia

Posted 15 August 2009 - 08:19 AM

I've done some more reading, in VistaPE API, in [Process] section, VistaPE API, there are two commands:
AddAutoRun
AddPostConfig

They can be used to start programs. But I need to start a Windows service after network card drivers is initialized and obtain an DHCP IP address.

Anyone can help? :frusty: ;) :unsure:

#4 JonF

JonF

    Gold Member

  • .script developer
  • 1185 posts
  • Location:Boston, MA
  •  
    United States

Posted 15 August 2009 - 04:51 PM

I've done some more reading, in VistaPE API, in [Process] section, VistaPE API, there are two commands:
AddAutoRun
AddPostConfig

They can be used to start programs. But I need to start a Windows service after network card drivers is initialized and obtain an DHCP IP address.

Maybe AddPostConfig,%SystemRoot%\System32\Net,"start ServiceName",4?

#5 DanTang

DanTang

    Newbie

  • Members
  • 23 posts
  •  
    Australia

Posted 17 August 2009 - 01:29 PM

Tried:
AddPostConfig,"Program Name",%SystemRoot%\System32\Net.exe,#$sstart#$sServiceName,4

:whistling: :cheers: Not working* :) :)

Tried:
AddPostConfig,NotePad,%SystemRoot%\System32\Notepad.exe,,4

:cheers: ;) Working ;) ;)

What does AddPostConfig do? Adding something to a batch file? Anybody has the name of the file?

Help pleaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaase!

#6 homes32

homes32

    Gold Member

  • .script developer
  • 1030 posts
  • Location:Minnesota
  •  
    United States

Posted 17 August 2009 - 02:04 PM

Tried:
AddPostConfig,"Program Name",%SystemRoot%\System32\Net.exe,#$sstart#$sServiceName,4

:whistling: :cheers: Not working* :) :)

Tried:
AddPostConfig,NotePad,%SystemRoot%\System32\Notepad.exe,,4

:cheers: ;) Working ;) ;)

What does AddPostConfig do? Adding something to a batch file? Anybody has the name of the file?

Help pleaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaase!

AddPostConfig adds a command to the vpeldr's config file that will be processed last thing before the loader exits.
if you look in your target dir you can view the contents of vistape.cfg and targetdir\windows\system32\vistape.cfg with any text editor and see the commands the loader will process.

#7 dera

dera

    Gold Member

  • .script developer
  • 1335 posts
  •  
    Hungary

Posted 17 August 2009 - 02:07 PM

AddPostConfig adds an entry to the [postconfig] section in the file: vistape.cfg
when booting VistaPE the vpeldr.exe will execute these lines as last steps
(like a HKLM\Software\Microsoft\Windows\CurrentVersion\Run entry in normal windows or like a \ Start Menu\ Programs\ Startup\ autostart entry)

e.g. at me this line is working:
AddPostConfig,start_mms,x:\windows\system32\net.exe,start mms,3
(the above example starts the 'mms' services of Acronis Backup And Recovery 10)

#8 DanTang

DanTang

    Newbie

  • Members
  • 23 posts
  •  
    Australia

Posted 17 August 2009 - 02:22 PM

AddPostConfig adds an entry to the [postconfig] section in the file: vistape.cfg
when booting VistaPE the vpeldr.exe will execute these lines as last steps
(like a HKLM\Software\Microsoft\Windows\CurrentVersion\Run entry in normal windows or like a \ Start Menu\ Programs\ Startup\ autostart entry)

e.g. at me this line is working:
AddPostConfig,start_mms,x:\windows\system32\net.exe,start mms,3
(the above example starts the 'mms' services of Acronis Backup And Recovery 10)



What does the added line looks like in the [postconfig] section, mine has nothing after AddPostConfig command, I'll try again now!

#9 dera

dera

    Gold Member

  • .script developer
  • 1335 posts
  •  
    Hungary

Posted 17 August 2009 - 02:32 PM

[postconfig]
hidewait|start_mms|x:\windows\system32\net.exe start mms

#10 dera

dera

    Gold Member

  • .script developer
  • 1335 posts
  •  
    Hungary

Posted 17 August 2009 - 02:45 PM

usually every VistaPE app. script contains something similar lines:
e.g.

[Interface]
pCheckBox1="Run from ram (boot.wim)",1,3,28,16,320,18,True

[process]
RunFromRam,%pCheckBox1%

in case of 'RunFromRam,True'
the file 'windows\system32\vistape.cfg' packed into vistape.wim
will contain this postconfig entry

in case of 'RunFromRam,False'
the vistape.cfg in the root of the builded CD
will contain this postconfig entry

#11 JonF

JonF

    Gold Member

  • .script developer
  • 1185 posts
  • Location:Boston, MA
  •  
    United States

Posted 17 August 2009 - 03:08 PM

Note that there are two vistape.cfg files, one in the root of the CD and one in Windows\System32. This has already been posted but it's not certain (to me) that you noticed it and checked both of them.

When you are editing a script's source code in WinBuilder, you can click the Magic Wand button or right-click where you want to insert a command, and you will get a menu that covers almost all of them. The AddPostConfig command is an "API command" which is added to WinBuilder's base commands by the API script in a project. API command are listed at the bottom of the first Magic Wand menu.

There's some documentation of the VistaPE API at http://www.vistape.n...istape-api.html. The "Description of commands and options" heading is the one I find the most useful.

The VistaPE-CAPI project uses a "Common API" script, which works in multiple projects, and extends some of the commands described at the above link (ReadEnv springs t mind).

#12 DanTang

DanTang

    Newbie

  • Members
  • 23 posts
  •  
    Australia

Posted 17 August 2009 - 03:22 PM

usually every VistaPE app. script contains something similar lines:
e.g.

[Interface]
pCheckBox1="Run from ram (boot.wim)",1,3,28,16,320,18,True

[process]
RunFromRam,%pCheckBox1%

in case of 'RunFromRam,True'
the file 'windows\system32\vistape.cfg' packed into vistape.wim
will contain this postconfig entry

in case of 'RunFromRam,False'
the vistape.cfg in the root of the builded CD
will contain this postconfig entry



Do you imply that if I use RunFromRAM command, I should not use AddPostConfig at same time?

#13 dera

dera

    Gold Member

  • .script developer
  • 1335 posts
  •  
    Hungary

Posted 17 August 2009 - 03:47 PM

Do you imply

No,
of course it is possible to use AddPostConfig in both case

as JonF explained:

Note that there are two vistape.cfg files, one in the root of the CD and one in Windows\System32. This has already been posted but it's not certain (to me) that you noticed it and checked both of them.



#14 JonF

JonF

    Gold Member

  • .script developer
  • 1185 posts
  • Location:Boston, MA
  •  
    United States

Posted 17 August 2009 - 03:54 PM

Do you imply that if I use RunFromRAM command, I should not use AddPostConfig at same time?

No. He's just listing some of the circumstances in which one vistape.cfg file contains the information generated by a particular script, and when the other vistape.cfg file contains it.

IT is a good idea toinclude the checkbox and RunFrom Ram, but it's independent of AddPostConfig.

BTW, if you look in Base\07-config.script, you will find several examples of starting services withj AddPostConfig.

#15 DanTang

DanTang

    Newbie

  • Members
  • 23 posts
  •  
    Australia

Posted 19 August 2009 - 05:30 AM

Thanks All.


The AddPostConfig works well. The problem was the Vista project I downloaded did not function properly. People should download the VistaPE project from VistaPe.Winbuilder.net instead of vistape.net/project.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users