Jump to content











Photo
- - - - -

Point to the real Windows Installation


  • Please log in to reply
17 replies to this topic

#1 Virtual-R

Virtual-R

    Frequent Member

  • Advanced user
  • 145 posts
  • Location:Stockholm, Sweden
  •  
    Sweden

Posted 02 September 2009 - 02:54 PM

Hello everybody! :whistling:

I have tried Paragliders Settargetroot program in Win7pe but it never runs. I don't know if any nessesary file is missing.

What I want to do, is to start regedit on the real Windows-installation. Problem is, I can not always ASSUME that this will be on C:

For now, I have made a cmd-file with these parameters:

@Echo off

Start SetTargetRoot.exe /s /w Runscanner.exe /t 0 %windir%\System32\Regedit.exe

However, since Settargetroot won't start this program does't work. An easy Solution would have been: Runscanner.exe C:\Windows\\System32\Regedit.exe, but as you all know, this is not reliable, since some machines doesn't have Windows on ther C-drive! :P

Any Suggestions?? Thank you in advance!

UPDATE 090904: Solved! Here is the finished scripts if someone wants it

Attached Files



#2 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 02 September 2009 - 03:21 PM

Hello everybody! :whistling:

I have tried Paragliders Settargetroot program in Win7pe but it never runs. I don't know if any nessesary file is missing.

What I want to do, is to start regedit on the real Windows-installation. Problem is, I can not always ASSUME that this will be on C:

For now, I have made a cmd-file with these parameters:

@Echo off

Start SetTargetRoot.exe /s /w Runscanner.exe /t 0 %windir%\System32\Regedit.exe

However, since Settargetroot won't start this program does't work. An easy Solution would have been: Runscanner.exe C:\Windows\\System32\Regedit.exe, but as you all know, this is not reliable, since some machines doesn't have Windows on ther C-drive! :P

Any Suggestions?? Thank you in advance!


Is this generic or specific to Win7PE?

Maybe it's better if I move it to here?:
http://www.boot-land...hp?showforum=91

If you know that Windows is installed in \Windows you can have something like:
FOR %%? 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 %%?&#58;\Windows\System32\<somesystemfile> &#40;

SET MYDRIVE=%%?

GOTO &#58;FOUND

&#41;

&#41;

GOTO &#58;EOF



&#58;FOUND

Runscanner.exe /t 0 %MYDRIVE%\WINDOWS\System32\Regedit.exe

Or you need to parse a DIR command output for each possible drive to find a \System32\<somesystemfile>....

jaclaz

#3 Virtual-R

Virtual-R

    Frequent Member

  • Advanced user
  • 145 posts
  • Location:Stockholm, Sweden
  •  
    Sweden

Posted 02 September 2009 - 04:23 PM

Thank you so much, Jaclaz, I think it's pretty close to work now.

Now I get this error:
The Original 365 could not be located in the dynamic library COMCTL32.dll

This is the code now:

@echo off
FOR %%? 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 %%?:\Windows\System32\defrag.exe (
SET MYDRIVE=%%?
GOTO :FOUND
)
)
GOTO :EOF

:FOUND
Runscanner.exe /t 0 %MYDRIVE%:\WINDOWS\Regedit.exe

#4 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 02 September 2009 - 05:06 PM

Now I get this error:
The Original 365 could not be located in the dynamic library COMCTL32.dll


WHAT?
That means that it only finds a Fake 365! :D

Maybe it's ordinal...:whistling::P

Usually it's a problem with a mismatch of version of the .dll. (COMCTL32.dll in this case) :D

:D


jaclaz

#5 paraglider

paraglider

    Gold Member

  • .script developer
  • 1729 posts
  • Location:NC,USA
  •  
    United States

Posted 02 September 2009 - 11:44 PM

runscanner will automatically find your windows installation for you. No need to use settargetroot or a batch file. There is no guarantee that it is possible to run the remote regedit unless your PE and the target windows installation are exactly the same version of windows. If that is the case then the PE one will be the same. You should run the one on your PE and use runscanner to redirect to the target windows installation.

settargetroot will set the TARGET_ROOT environment variable so it should be:

SetTargetRoot.exe /s /w Runscanner.exe /t 0 %TARGET_ROOT%\System32\Regedit.exe

However the start command will probably expand the environment variable before launching settargetroot so you have not gained anything.

#6 paraglider

paraglider

    Gold Member

  • .script developer
  • 1729 posts
  • Location:NC,USA
  •  
    United States

Posted 03 September 2009 - 12:59 AM

Did some experimenting with settargetroot on win7pe. It works ok.

However it runs the target program hidden hence the reason it appeared not to be working.

I have produced an updated version ( http://www.paraglide...getRoot1006.cab ) which can be downloaded from my website that defaults to running the program visible. Adding a /h parameter will run the program hidden as in previous versions.

Its better to use /f - that will find vista and win7 installations.

#7 Virtual-R

Virtual-R

    Frequent Member

  • Advanced user
  • 145 posts
  • Location:Stockholm, Sweden
  •  
    Sweden

Posted 03 September 2009 - 07:43 AM

WHAT?
That means that it only finds a Fake 365! :)

Maybe it's ordinal...:);)

Usually it's a problem with a mismatch of version of the .dll. (COMCTL32.dll in this case) :)

:)


jaclaz


Haha, a FAKE? :S Sounds crazy, but I will download a different COMCTL32.dll as soon as I have tried Paragliders tip ! ;)
I will post results of both tips!

#8 Virtual-R

Virtual-R

    Frequent Member

  • Advanced user
  • 145 posts
  • Location:Stockholm, Sweden
  •  
    Sweden

Posted 03 September 2009 - 09:38 AM

Did some experimenting with settargetroot on win7pe. It works ok.

However it runs the target program hidden hence the reason it appeared not to be working.

I have produced an updated version ( http://www.paraglide...getRoot1006.cab ) which can be downloaded from my website that defaults to running the program visible. Adding a /h parameter will run the program hidden as in previous versions.

Its better to use /f - that will find vista and win7 installations.


@Paraglider: When I use your new Settargetroot with THIS code:
SetTargetRoot.exe /s /w /f Runscanner.exe /t 0 %TARGET_ROOT%\Regedit.exe

The script executes like this:

(The command prompt showing)
SetTargetroot.exe /s /w /f Runscanner.exe /t 0 \Regedit.exe
I see that Settargetroot.exe is in the processlist. Runscanner launches then it says:
Create of target process failed, ret=2: The system cannot find the file specified.
This makes sence, since the command executed with \Regedit.exe and not C:\Windows\Regedit.exe. This means that Settargetroot appears not finding the Windows-install.
Any ideas?

@ Jaclaz: Hmm.. I don't know how to change that file, it is in the original install-dir from a real Windows 7 RTM

If someone is wondering, I work at a computer company, so we already got legit access to the real Windows 7 RTM.

#9 paraglider

paraglider

    Gold Member

  • .script developer
  • 1729 posts
  • Location:NC,USA
  •  
    United States

Posted 03 September 2009 - 12:13 PM

Exactly what I said above - the shell expands the environment variable before it calls settargetroot. You need to provide a level of indirection.

use settargetroot to launch a batch file. The batch file will then have access to the TARGET_ROOT variable which will then be able to launch runscanner using the TARGET_ROOT.

To check if settargetroot worked look in the PE registry at:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

#10 Virtual-R

Virtual-R

    Frequent Member

  • Advanced user
  • 145 posts
  • Location:Stockholm, Sweden
  •  
    Sweden

Posted 04 September 2009 - 09:10 AM

Exactly what I said above - the shell expands the environment variable before it calls settargetroot. You need to provide a level of indirection.

use settargetroot to launch a batch file. The batch file will then have access to the TARGET_ROOT variable which will then be able to launch runscanner using the TARGET_ROOT.

To check if settargetroot worked look in the PE registry at:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment


Alright! Here is a new modified reply :)

Now my config looks like this:

I have one script that copies Runscanner.exe and Runscannerdll.dll to the system32 folder, so the command can be used anywere.

I have one script for settargetroot.exe that has this files:
SetTargetRoot.exe
SetTargetRootRes_EN.dll
StartRunScanner1.cmd
StartRunScanner2.cmd

The script for settargetroot launches StartRunscanner1,cmd, which looks like this:
SetTargetRoot.exe /s /w StartRunScanner2.cmd

It executes StartRunscanner2.cmd, which looks like this:
Runscanner.exe /t 0 %TARGET_ROOT%\Regedit.exe

Once Runscanner2 is running, you can actually see that the command executes CORRECTLY, the resulting line becomes:
Runscanner.exe /t 0 C:\WINDOWS\Regedit.exe

So now Settargetroot has worked, and the command point to the correct location, but what happends now?

Suprise, the same error as I got with Jaclaz idea, I get a popup saying:
"The ordinal 365 could not be located in the dynamic library COMCTL32.dll"

As I said before, I have not changed or touched this file, called COMCTL32.dll, it's from
the original installation that is 100% from Windows 7 RTM.

Any ideas? :) And thank you again, Paraglider and Jaclaz, for helping!

#11 paraglider

paraglider

    Gold Member

  • .script developer
  • 1729 posts
  • Location:NC,USA
  •  
    United States

Posted 04 September 2009 - 12:03 PM

Is the version of comctl32.dll on your c:\windows the same version as on your PE? It they are exactly the same version of windows they should be. Otherwise it is a very bad idea to run programs from c:\windows from PE. Just for this very reason. Later versions of windows get new methods added to various system dlls.

You never did explain why you think you need to run regedit from c:\windows.

#12 Virtual-R

Virtual-R

    Frequent Member

  • Advanced user
  • 145 posts
  • Location:Stockholm, Sweden
  •  
    Sweden

Posted 04 September 2009 - 01:21 PM

Is the version of comctl32.dll on your c:\windows the same version as on your PE? It they are exactly the same version of windows they should be. Otherwise it is a very bad idea to run programs from c:\windows from PE. Just for this very reason. Later versions of windows get new methods added to various system dlls.

You never did explain why you think you need to run regedit from c:\windows.


Right now i am hitting my head with my flat hand. I think I have made a great mistake.
Of course I shall NOT run regedit from the "real" windows installation, because as you say, different dll-versions = problem. This was never what I wanted to do, I didn't think thisone out. I wanted to have the right target root, but of course the regedit program shall run from the PE-install, ABSOLUTELY NOT the windows-one.
I use my rescue cd on different computers every day since I am a computer technican, so therefore all the windows-installs I run against are different.

WOHOOO!!! Now it WORKS, THANK YOU Paraglider, THANKYOU Jaclaz, you guys are truly great.

What I wanted from the very first beginning, was to access regedit, but on the "real" windows installation, this works now, thanks to you guys.

If anyone who has followed this thread, and also want this now working plugin, can download it, I have attached the files.

You may have to change the line for %ProgramFolder%=Tools\SetTargetRoot
and %ProgramFolder%=Tools\Runscanner to fit your own needs!

Greetings // VR

Attached Files



#13 paraglider

paraglider

    Gold Member

  • .script developer
  • 1729 posts
  • Location:NC,USA
  •  
    United States

Posted 05 September 2009 - 02:38 AM

There is no need to use settargetroot. That functionality is built into runscanner:

RunScanner.exe /t 0 /ac /sd /y /m+ %SystemRoot%\regedit.exe


will load regedit from PE pointing at the real windows installation.

#14 paraglider

paraglider

    Gold Member

  • .script developer
  • 1729 posts
  • Location:NC,USA
  •  
    United States

Posted 05 September 2009 - 02:40 AM

Current version of my runscanner.script is downloadable from:

http://www.paraglidernc.com/winbuilder


or via winbuilder using the above server address.

#15 JonF

JonF

    Gold Member

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

Posted 05 September 2009 - 02:39 PM

It's nice to have an official version ...
An indication of the version of Runscanner and the version of the script would be nice additions.

#16 paraglider

paraglider

    Gold Member

  • .script developer
  • 1729 posts
  • Location:NC,USA
  •  
    United States

Posted 05 September 2009 - 11:47 PM

Done. Its now downloadable from within winbuilder. Just add server www.paraglidernc.com/winbuilder

#17 Virtual-R

Virtual-R

    Frequent Member

  • Advanced user
  • 145 posts
  • Location:Stockholm, Sweden
  •  
    Sweden

Posted 07 September 2009 - 08:06 AM

There is no need to use settargetroot. That functionality is built into runscanner:

RunScanner.exe /t 0 /ac /sd /y /m+ %SystemRoot%\regedit.exe


will load regedit from PE pointing at the real windows installation.



OHHHH!!!! I feel a bit dumb now, but at the same time very happy because I now understand everything better! ;)

#18 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 12 September 2009 - 06:41 PM

Done. Its now downloadable from within winbuilder. Just add server www.paraglidernc.com/winbuilder

Nice :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users