Jump to content











Photo
- - - - -

PicoXP - Autorun?


  • Please log in to reply
13 replies to this topic

#1 Jeremy Mlazovsky

Jeremy Mlazovsky

    Newbie

  • Members
  • 11 posts

Posted 11 September 2006 - 06:54 PM

I made a new Tweak script which copies the files necessary for ChkDsk to run. Wonderful.

I am trying to figure out how to make PicoXP automatically run the following command at startup:

"chkdsk /r /x C:"

I modified my Chkdsk script so that it adds the following registry key to the system32\config\software hive:

HLKM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\Chkdsk -> REG_SZ -> "chkdsk /r /x C:"

But when it boots, it only goes to the cmd.exe shell ... nothing happens. I can confirm that that value is in the registry because I extracted the SOFTWARE hive from the .ISO and loaded it into regedit.

I also modified the script to run a batch file instead, but same thing.

Any ideas?

#2 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 11 September 2006 - 07:02 PM

I made a new Tweak script which copies the files necessary for ChkDsk to run. Wonderful.

I am trying to figure out how to make PicoXP automatically run the following command at startup:

"chkdsk /r /x C:"

I modified my Chkdsk script so that it adds the following registry key to the system32\config\software hive:

HLKM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\Chkdsk -> REG_SZ -> "chkdsk /r /x C:"

But when it boots, it only goes to the cmd.exe shell ... nothing happens. I can confirm that that value is in the registry because I extracted the SOFTWARE hive from the .ISO and loaded it into regedit.

I also modified the script to run a batch file instead, but same thing.

Any ideas?


Please post the executing part and the log of your checkdisk.script and tomorrow I'll check.
(If you think it's private, PM it to me)

Peter

#3 smiley

smiley

    Silver Member

  • .script developer
  • 905 posts
  •  
    Greece

Posted 11 September 2006 - 07:28 PM

I made a new Tweak script which copies the files necessary for ChkDsk to run. Wonderful.

I am trying to figure out how to make PicoXP automatically run the following command at startup:

"chkdsk /r /x C:"

I modified my Chkdsk script so that it adds the following registry key to the system32\config\software hive:

HLKM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\Chkdsk -> REG_SZ -> "chkdsk /r /x C:"

But when it boots, it only goes to the cmd.exe shell ... nothing happens. I can confirm that that value is in the registry because I extracted the SOFTWARE hive from the .ISO and loaded it into regedit.

I also modified the script to run a batch file instead, but same thing.

Any ideas?


RunOnce values are executed by explorer, so when explorer doesn't exist, RunOnce isn't executes

#4 Jeremy Mlazovsky

Jeremy Mlazovsky

    Newbie

  • Members
  • 11 posts

Posted 11 September 2006 - 07:28 PM

Please post the executing part and the log of your checkdisk.script and tomorrow I'll check.


Here is the script:

[main]

Title=Chkdsk

Description=This wil copy the files necessary to run chkdsk in PicoXP.

Selected=True

Level=5

Author=Jeremy Mlazovsky

Contact=

Credits=

Version=002

Date=2006-09-08

Locked=false

OS=All

Updates=



[Interface]

pTextLabel2="This will copy the files necessary for chkdsk to run.",1,1,21,34,459,81,8,Normal

pTextLabel3="What does it do?",1,1,12,13,126,18,9,Bold



[InterfaceEncoded]



[AuthorEncoded]



[checkOS]

If,%ForOS%,NotEqual,%OS%,Message,"This script is created for %ForOS%.#$xYou are working with %OS%.#$xThat may create problems.",Warning



[Process]

IniRead,"%ProjectDir%\ProjectInfo.ini","OS","Type","%OS%"

IniRead,"%ScriptFile%","Main","OS","%ForOS%"

If,%ForOS%,NotEqual,"All",Run,%ScriptFile%,checkOS

Echo,"Copying Chkdsk files.."

Expand,"%SourceDir%\I386\CFGMGR32.DL_","%TargetDir%\i386"

Expand,"%SourceDir%\I386\CHKDSK.EX_","%TargetDir%\i386"

Expand,"%SourceDir%\I386\ULIB.DL_","%TargetDir%\i386"

Expand,"%SourceDir%\I386\IFSUTIL.DL_","%TargetDir%\i386"

Echo,"Writing Chkdsk batch file (c.cmd).."

FileCreateBlank,"%TargetDir%\i386\system32\c.cmd"

TxtAddLine,"%TargetDir%\i386\system32\c.cmd","chkdsk /r /x C:","append"

echo,"Loading SOFTWARE registry hive.."

RegHiveLoad,"PicoXP_SOFTWARE","%targetdir%\i386\system32\config\software"

echo,"Setting Chkdsk to run at startup.."

RegWrite,HKLM,0x1,"PicoXP_SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce","Chkdsk","chkdsk /r /x C:"

echo,"Unloading hive.."

RegHiveUnLoad,"PicoXP_SOFTWARE"

echo,"All done"



[Variables]

%OS%=

%ForOS%=

%i%=0

%inc%=%BaseDir%\Temp\inc.txt

%ProjectInfo%=%ProjectDir%\ProjectInfo.ini


#5 Jeremy Mlazovsky

Jeremy Mlazovsky

    Newbie

  • Members
  • 11 posts

Posted 11 September 2006 - 08:01 PM

RunOnce values are executed by explorer, so when explorer doesn't exist, RunOnce isn't executes


That makes sesne.

I figured it out ... I looked at the script for making CMD the default shell. I copied that code to my script and made the batch file the shell.

I am going to try to modify it to use CMD as the shell but have it start a new window with chkdsk in it.

#6 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 11 September 2006 - 09:22 PM

I am going to try to modify it to use CMD as the shell but have it start a new window with chkdsk in it.

:P :P :P
Peter

#7 Draugen

Draugen

    Frequent Member

  • .script developer
  • 147 posts
  • Location:South of Heaven

Posted 12 September 2006 - 06:47 AM

@Jeremy: in case you're stuck (you seem competent enough tho :P ) here's a way to enable (pseudo)autorun:

- set the shell (in setupreg.hiv) to cmd.exe autorun.cmd

AUTORUN.CMD:
@echo off

call (first batch file)

call (second batch file)

(...snip...)

start cmd /k

note: this is untested. It should work though. CMDOW.exe or HIDEC.exe should work to hide the command window from AUTORUN.CMD.

//martin

#8 Jeremy Mlazovsky

Jeremy Mlazovsky

    Newbie

  • Members
  • 11 posts

Posted 12 September 2006 - 11:23 AM

@Jeremy: in case you're stuck (you seem competent enough tho :P ) here's a way to enable (pseudo)autorun:

- set the shell (in setupreg.hiv) to cmd.exe autorun.cmd

AUTORUN.CMD:

@echo off

call (first batch file)

call (second batch file)

(...snip...)

start cmd /k


Thanks for the tip ... I like your suggestion better than the way I am doing it now!

Actually, now that I think about it, it might be a good idea to make it so that the "[Build] Set CMD.EXE as default shell" script by default is set to run "cmd.exe autorun.cmd" as well as create a stub autorun.cmd. That way, scripts like mine can just append lines of code to the end of autorun.cmd :P

#9 Jeremy Mlazovsky

Jeremy Mlazovsky

    Newbie

  • Members
  • 11 posts

Posted 12 September 2006 - 03:25 PM

- set the shell (in setupreg.hiv) to cmd.exe autorun.cmd


Actually, now that I think about it, it might be a good idea to make it so that the "[Build] Set CMD.EXE as default shell" script by default is set to run "cmd.exe autorun.cmd" as well as create a stub autorun.cmd. That way, scripts like mine can just append lines of code to the end of autorun.cmd :lightbulb:

Here is my modified code for "[Build] Set CMD.EXE as default shell":
[process]

echo,"Creating shell.cmd.."

FileCreateBlank,"%TargetDir%\i386\system32\shell.cmd"

TXTAddLine,"%TargetDir%\i386\system32\shell.cmd","cls","Append"

TXTAddLine,"%TargetDir%\i386\system32\shell.cmd","cmd.exe","Append"

echo,"Loading setup registry hive.."

RegHiveLoad,"Build","%targetdir%\i386\system32\setupreg.hiv"

echo,"Writing new value.."

RegWrite,HKLM,0x1,"Build\Setup","CmdLine","%PEsys32%\shell.cmd"

echo,"Unloading hive.."

RegHiveUnLoad,"Build"

echo,"All done"

Run,%ScriptLog%,Process-log

Here is my code for my "[Tweaks] Run Chkdsk at startup" script:
[code=auto:0]
[main]
Title=Set CMD.EXE as default shell
Description=This script will set CMD.EXE as the default system shell
Selected=True
level=3
Author=Boot Land community
Version=002
Date=

#10 Jeremy Mlazovsky

Jeremy Mlazovsky

    Newbie

  • Members
  • 11 posts

Posted 12 September 2006 - 03:27 PM

- set the shell (in setupreg.hiv) to cmd.exe autorun.cmd


Actually, now that I think about it, it might be a good idea to make it so that the "[Build] Set CMD.EXE as default shell" script by default is set to run "cmd.exe autorun.cmd" as well as create a stub autorun.cmd. That way, scripts like mine can just append lines of code to the end of autorun.cmd :lightbulb:

Here is my modified code for "[Build] Set CMD.EXE as default shell":
[process]

echo,"Creating shell.cmd.."

FileCreateBlank,"%TargetDir%\i386\system32\shell.cmd"

TXTAddLine,"%TargetDir%\i386\system32\shell.cmd","cls","Append"

TXTAddLine,"%TargetDir%\i386\system32\shell.cmd","cmd.exe","Append"

echo,"Loading setup registry hive.."

RegHiveLoad,"Build","%targetdir%\i386\system32\setupreg.hiv"

echo,"Writing new value.."

RegWrite,HKLM,0x1,"Build\Setup","CmdLine","%PEsys32%\shell.cmd"

echo,"Unloading hive.."

RegHiveUnLoad,"Build"

echo,"All done"

Run,%ScriptLog%,Process-log

Here is my code for my "[Tweaks] Run Chkdsk at startup" script:
[code=auto:0]
[main]
Title=Set CMD.EXE as default shell
Description=This script will set CMD.EXE as the default system shell
Select

#11 Jeremy Mlazovsky

Jeremy Mlazovsky

    Newbie

  • Members
  • 11 posts

Posted 12 September 2006 - 03:28 PM

- set the shell (in setupreg.hiv) to cmd.exe autorun.cmd


Actually, now that I think about it, it might be a good idea to make it so that the "[Build] Set CMD.EXE as default shell" script by default is set to run "cmd.exe autorun.cmd" as well as create a stub autorun.cmd. That way, scripts like mine can just append lines of code to the end of autorun.cmd :lightbulb:

Here is my modified code for "[Build] Set CMD.EXE as default shell":
[process]

echo,"Creating shell.cmd.."

FileCreateBlank,"%TargetDir%\i386\system32\shell.cmd"

TXTAddLine,"%TargetDir%\i386\system32\shell.cmd","cls","Append"

TXTAddLine,"%TargetDir%\i386\system32\shell.cmd","cmd.exe","Append"

echo,"Loading setup registry hive.."

RegHiveLoad,"Build","%targetdir%\i386\system32\setupreg.hiv"

echo,"Writing new value.."

RegWrite,HKLM,0x1,"Build\Setup","CmdLine","%PEsys32%\shell.cmd"

echo,"Unloading hive.."

RegHiveUnLoad,"Build"

echo,"All done"

Run,%ScriptLog%,Process-log

Here is my code for my "[Tweaks] Run Chkdsk at startup" script:
[code=auto:0]
[main]
Title=Set CMD.EXE as default shell
Description=This script will set CMD.EXE as the default system shell
Select

#12 Jeremy Mlazovsky

Jeremy Mlazovsky

    Newbie

  • Members
  • 11 posts

Posted 12 September 2006 - 03:32 PM

Actually, now that I think about it, it might be a good idea to make it so that the "[Build] Set CMD.EXE as default shell" script by default is set to run "cmd.exe autorun.cmd" as well as create a stub autorun.cmd. That way, scripts like mine can just append lines of code to the end of autorun.cmd :lightbulb:

Here is my modified code for "[Build] Set CMD.EXE as default shell":
[process]

echo,"Creating shell.cmd.."

FileCreateBlank,"%TargetDir%\i386\system32\shell.cmd"

TXTAddLine,"%TargetDir%\i386\system32\shell.cmd","cls","Append"

TXTAddLine,"%TargetDir%\i386\system32\shell.cmd","cmd.exe","Append"

echo,"Loading setup registry hive.."

RegHiveLoad,"Build","%targetdir%\i386\system32\setupreg.hiv"

echo,"Writing new value.."

RegWrite,HKLM,0x1,"Build\Setup","CmdLine","%PEsys32%\shell.cmd"

echo,"Unloading hive.."

RegHiveUnLoad,"Build"

echo,"All done"

Run,%ScriptLog%,Process-log

Here is my code for my "[Tweaks] Run Chkdsk at startup" script:

[main]

Title=Set CMD.EXE as default shell

Description=This script will set CMD.EXE as the default system shell

Selected=True

level=3

Author=Boot Land community

Version=002

Date=2006-09-12

Contact=http://BootLand.pt.vu

Locked=false

Updates=http://upload.boot-land.net



[process]

echo,"Creating shell.cmd.."

FileCreateBlank,"%TargetDir%\i386\system32\shell.cmd"

TXTAddLine,"%TargetDir%\i386\system32\shell.cmd","cls"


#13 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 12 September 2006 - 06:55 PM

Nice work!

Do you know if picoXP would also support SDI images to allow NTFS compression over PXE? :P

#14 smiley

smiley

    Silver Member

  • .script developer
  • 905 posts
  •  
    Greece

Posted 12 September 2006 - 07:00 PM

Nice work!

Do you know if picoXP would also support SDI images to allow NTFS compression over PXE? :P


I think that using SDI to achieve compression is useless because SDI by default uses some more space and because the result is already upxed and very small i believe that it will be bigger than the iso! :P I will test and post the results. :P

About supporting SDI images, i believe that it requires the same things with booting from RAM.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users