Jump to content











Photo
- - - - -

Need help using Runscanner in Win7PE SE


  • Please log in to reply
29 replies to this topic

#1 NightsEvil

NightsEvil

    Newbie

  • Members
  • 12 posts
  •  
    United States

Posted 20 January 2011 - 11:54 PM

Hello all, iv been using Winbuilder for a short time and so far i LOVE it. Some time ago i wrote my own application in C# for fixing computers (antivirus/partitioning/defraging/various other fixes) and iv been maintaining it ever since and have been looking for a bootable environment on which to integrate it into which was hard since it required .NET framework 2.0 or higher, then i found winbuilder and win7pe SE and thought i was in heaven lol.

My application loads and runs excellent but now i am trying to make my application work with the WINPE environment and hitting some issues with using runscanner. my application runs off of a flash drive (currently, but have plans on integrating it eventually), it extracts larger files to the Ramdisk X: and runs them from there VIA the environment variable "SystemDrive" every thing runs like a dream.

Now the problem im having is that say for example i want to run spybot, it extracts, then runs but i dont know how to call runscanner in X:\windows\system32\Runscanner.exe WITH my spybot that was extracted to X:\Spybot\SpybotSD.exe. For those who know C# codeing my code to start it looks like this:

string tempFolder = System.Environment.GetEnvironmentVariable("SystemDrive");

System.Diagnostics.Process Spybot1 = System.Diagnostics.Process.Start(tempFolder + "\\" + "Spybot" + "\\" + "SpybotSD.exe", "");

so any help getting runscanner to work with it would be MUCH appreciated i tried to just do this

string tempFolder = System.Environment.GetEnvironmentVariable("SystemDrive");

System.Diagnostics.Process Spybot1 = System.Diagnostics.Process.Start(@"X:\Windows\System32\Runscanner.exe" + tempFolder + "\\" + "Spybot" + "\\" + "SpybotSD.exe", "");

but no go, so.. any helpers?

#2 paraglider

paraglider

    Gold Member

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

Posted 21 January 2011 - 12:24 AM

Spybot has built in support for pe so no need to run it with runscanner.

#3 paraglider

paraglider

    Gold Member

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

Posted 21 January 2011 - 12:26 AM

The target process is a parameter so:

System.Diagnostics.Process Spybot1 = System.Diagnostics.Process.Start(@"X:\Windows\System32\Runscanner.exe", tempFolder + "\\" + "Spybot" + "\\" + "SpybotSD.exe");

#4 paraglider

paraglider

    Gold Member

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

Posted 21 January 2011 - 12:27 AM

You more than likely will need some parameters to runscanner. See http://www.paraglide.../runscanner.htm for full details of parameters.

#5 NightsEvil

NightsEvil

    Newbie

  • Members
  • 12 posts
  •  
    United States

Posted 21 January 2011 - 01:18 AM

Spybot has built in support for pe so no need to run it with runscanner.


Yea i had noticed that but i was just using spybot as an example, another would be like.. malwarebytes or a few command line scanners that i am using.

#6 al_jo

al_jo

    Gold Member

  • Members
  • 1218 posts
  • Location:Tellus

Posted 21 January 2011 - 08:17 AM

How and where in the Revouninstaller script
http://al-jo.zxq.net...staller1.90.rar
do I modify it so that it starts with Runscanner automatically
without the need of right clicking and choose “Run with Runscanner”?
T.i.a.

#7 paraglider

paraglider

    Gold Member

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

Posted 21 January 2011 - 01:25 PM

Here is an example Add_shortcut for runscanner:

Add_Shortcut,StartMenu,Internet,#$pSystemRoot#$p\System32\RunScanner.exe,HijackThis!,#$pSystemRoot#$p\System32,"/t 0 /sv /ac /sd /m+ /y /d #$q%PE_Programs%\%ProgramFolder%\HijackThis.exe#$q",%PE_Programs%\%ProgramFolder%\HijackThis.exe

#8 NightsEvil

NightsEvil

    Newbie

  • Members
  • 12 posts
  •  
    United States

Posted 21 January 2011 - 09:53 PM

Here is an example Add_shortcut for runscanner:

Add_Shortcut,StartMenu,Internet,#$pSystemRoot#$p\System32\RunScanner.exe,HijackThis!,#$pSystemRoot#$p\System32,"/t 0 /sv /ac /sd /m+ /y /d #$q%PE_Programs%\%ProgramFolder%\HijackThis.exe#$q",%PE_Programs%\%ProgramFolder%\HijackThis.exe


well thanks but i was wondering if there was a way i can just call runscanner + arguments with my program with arguments in c# kinda like how my application does but with runscanner, is that doable?

#9 paraglider

paraglider

    Gold Member

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

Posted 22 January 2011 - 01:54 AM

Already posted above how its done in c#,

#10 NightsEvil

NightsEvil

    Newbie

  • Members
  • 12 posts
  •  
    United States

Posted 22 January 2011 - 08:41 AM

is this the C# code your referring to?

Add_Shortcut,StartMenu,Internet,#$pSystemRoot#$p\System32\RunScanner.exe,HijackThis!,#$pSystemRoot#$p\System32,"/t 0 /sv /ac /sd /m+ /y /d #$q%PE_Programs%\%ProgramFolder%\HijackThis.exe#$q",%PE_Programs%\%ProgramFolder%\HijackThis.exe

because that doesn't look like C# coding to me (i could be wrong i am still new to programing) also FYI i am using visual studio express 2010.

Edited by NightsEvil, 22 January 2011 - 08:42 AM.


#11 paraglider

paraglider

    Gold Member

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

Posted 22 January 2011 - 12:47 PM

Did you not look at posts #3 ( http://reboot.pro/13...post__p__119872 ) and #4.

The Add_shortcut was a response to the question in post #6.

If you are writing programs to run on PE then its better to write them in C++. If its a gui app use MFC or WTL. I prefer WTL as it has a much smaller runtime overhead.

#12 NightsEvil

NightsEvil

    Newbie

  • Members
  • 12 posts
  •  
    United States

Posted 22 January 2011 - 08:57 PM

wow sorry i did not see post 3 for some reason i must of just skipped over it sorry, but now i have another issue. The issue is that i need to run the desired applications with they're OWN arguments in addition to running them with runscanner, and im getting the error "No overload for method 'Start' takes 3 arguments. What can i do about this? basicly i need to run runscanner, run the application AS an argument BUT i need the application to run using its own arguments aswell as such

System.Diagnostics.Process Spybot1 = System.Diagnostics.Process.Start(@"X:\Windows\System32\Runscanner.exe", tempFolder + "\\" + "Spybot" + "\\" + "SpybotSD.exe", "/autocheck /autofix");

but that throws that error because of the extra parameter

Edited by NightsEvil, 22 January 2011 - 09:00 PM.


#13 sbaeder

sbaeder

    Gold Member

  • .script developer
  • 1338 posts
  • Location:usa - massachusettes
  •  
    United States

Posted 22 January 2011 - 09:15 PM

wow sorry i did not see post 3 for some reason i must of just skipped over it sorry, but now i have another issue. The issue is that i need to run the desired applications with they're OWN arguments in addition to running them with runscanner, and im getting the error "No overload for method 'Start' takes 3 arguments. What can i do about this? basicly i need to run runscanner, run the application AS an argument BUT i need the application to run using its own arguments aswell as such

System.Diagnostics.Process Spybot1 = System.Diagnostics.Process.Start(@"X:\Windows\System32\Runscanner.exe", tempFolder + "\\" + "Spybot" + "\\" + "SpybotSD.exe", "/autocheck /autofix");

but that throws that error because of the extra parameter

try making the "parameter" to runscanner be the entire command line you want it to run - i.e. executable AND parameters inside a single string...

#14 NightsEvil

NightsEvil

    Newbie

  • Members
  • 12 posts
  •  
    United States

Posted 22 January 2011 - 09:40 PM

try making the "parameter" to runscanner be the entire command line you want it to run - i.e. executable AND parameters inside a single string...


not sure if i know exactly what you mean, since the programs i'm using require parameter then the program needs to be the parameter of runscanner how else can it be written?

#15 sbaeder

sbaeder

    Gold Member

  • .script developer
  • 1338 posts
  • Location:usa - massachusettes
  •  
    United States

Posted 22 January 2011 - 10:10 PM

not sure if i know exactly what you mean, since the programs i'm using require parameter then the program needs to be the parameter of runscanner how else can it be written?

System.Diagnostics.Process Spybot1 = System.Diagnostics.Process.Start(@"X:\Windows\System32\Runscanner.exe", 

tempFolder + "\\" + "Spybot" + "\\" + 

"SpybotSD.exe /autocheck /autofix");

Or if you like
System.Diagnostics.Process Spybot1 = System.Diagnostics.Process.Start(@"X:\Windows\System32\Runscanner.exe", 

tempFolder + "\\" + "Spybot" + "\\" + 

"SpybotSD.exe" + " /autocheck /autofix");

Just make the "parameter" to runscanner be a string that has the executable AND parameter...

#16 NightsEvil

NightsEvil

    Newbie

  • Members
  • 12 posts
  •  
    United States

Posted 22 January 2011 - 11:26 PM

ok well that cleared up the errors and compiled ok but now i have a question. So it starts my application like its supposed to but is there any way to know if runscanner ACTUALLY loaded as it was supposed to? i tried looking under tast manager and i didnt see it. So what do i do?

#17 paraglider

paraglider

    Gold Member

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

Posted 23 January 2011 - 02:14 PM

Runscanner should appear under task manager / processes. Depending on runscanner parameters you should see runscanner dialogs first. If the first parameter to runscanner is the target application to launch then you should see a browse for folder dialog from runscanner.

Note if your target application launches another application and exits then runscanner will exit and no registry redirection will happen.

#18 NightsEvil

NightsEvil

    Newbie

  • Members
  • 12 posts
  •  
    United States

Posted 24 January 2011 - 07:26 AM

yea well this is what i did, i opend task manager and watched it very closely as my application launched this code

System.Diagnostics.Process Spybot1 = System.Diagnostics.Process.Start(@"X:\Windows\System32\Runscanner.exe", 

tempFolder + "\\" + "Spybot" + "\\" + 

"SpybotSD.exe /autocheck /autofix");

and spybot launched but i never saw any dialogs for runscanner or even runscanner under the task manager so what am i doing wrong? Also i noticed under runscanner script in winbuilder project Win7pe SE (which is what i am using) it has all the checkbox's checked for /t 0 /sd /ac /m+ /y it was my assumption that when runscanner was run with a application as its parameter that those parameters for runscanner would be used automatically is this correct?

#19 ChrisR

ChrisR

    Silver Member

  • .script developer
  • 784 posts
  •  
    France

Posted 24 January 2011 - 09:23 AM

Also i noticed under runscanner script in winbuilder project Win7pe SE (which is what i am using) it has all the checkbox's checked for /t 0 /sd /ac /m+ /y it was my assumption that when runscanner was run with a application as its parameter that those parameters for runscanner would be used automatically is this correct?

No it is not completely correct, the switches are used here only for "Remote Regedit" and the second switch are used when you launch an application using the option "Run with Runscanner" in Explorer ContextMenu (as written on the interface).

For use with a particular application (eg HijackThis), the parameters are written into the script using the add_shortcut as in the example.

#20 paraglider

paraglider

    Gold Member

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

Posted 24 January 2011 - 12:46 PM

This little test program worked for me:

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace Launcher
{
class Program
{
static void Main(string[] args)
{
Process prc = Process.Start(@"e:\ZIP\CD-Utilities\Pebldr3110a\plugin\RunScanner\Files\RunScanner.exe", @"e:\ZIP\CD-Utilities\Pebldr3110a\plugin\HijackThis\Files\HijackThis.exe");
prc.WaitForExit();
}
}
}


So its either your environment or a something with spybot which does not need runscanner. If another program loads the remote registry hives then it could cause problems to spybot as it also attempts to load remote registry hives.

#21 paraglider

paraglider

    Gold Member

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

Posted 24 January 2011 - 12:51 PM

First make sure runscanner works in your environment by running from the command line or from start menu shortcuts.

If you introduce too many variables then its difficult to work out which one is causing the problem. Start simple.

#22 NightsEvil

NightsEvil

    Newbie

  • Members
  • 12 posts
  •  
    United States

Posted 19 February 2011 - 06:05 PM

So i was going to use the /cp switch to launch my application so that all applications mine launched would be redirected (as i understand it) and when i tried to it gave me a error to install .net framework 2.0 .... but when i just start my application on its own it launches just fine.. so whats the deal?

#23 paraglider

paraglider

    Gold Member

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

Posted 19 February 2011 - 09:45 PM

I am not surprised - the /cp option is highly dangerous. A process may need to have access to the local registry to start. Sometimes it may work other times it will not.

Yo could try adjusting the timeout parameter. I have never tried runscanner with a .NET application. Its probably messing with the jit compile.

#24 NightsEvil

NightsEvil

    Newbie

  • Members
  • 12 posts
  •  
    United States

Posted 20 February 2011 - 10:51 AM

wracking my brain here i cant figure out why this works:

System.Diagnostics.Process CC = System.Diagnostics.Process.Start(@"X:\Windows\System32\Runscanner.exe", string.Format(@"/t 0 /ac /sd /m+ Programs\Cleaners\Ccleaner64.exe", "/TOOLS"));

but this wont:

System.Diagnostics.Process ASQ3 = System.Diagnostics.Process.Start(@"X:\Windows\System32\Runscanner.exe", string.Format(@"/t 0 /ac /sd /m+ X:\ASQ\a2cmd.exe", @"/f=C:\"));

whats wrong!? it starts runscanner, then it starts A-squared (command line malware scanner) but it just flashes the help screen and closes really fast so whats wrong?

#25 paraglider

paraglider

    Gold Member

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

Posted 20 February 2011 - 12:55 PM

There is no way the first one can work. Its a 64 bit process. Runscanner is a 32 bit debugger that attaches a 32 bit dll to the process being debugged.

/t 0 works for some programs and not others. Try increasing the timeout value see if that makes any difference.

Also the program being launched may have special code to detect it is being debugged and abort.

The usual way to debug why a program does not work with runscanner is to use tools like sysinternals procmon and dbgview. Compare output when running without runscanner and with and see what is different.

Add /d to runscanner command line and look at the additional debug output that runscanner generates to see if you get any clues.

Has anyone else managed to get runscanner working with a2cmd. If so what command line parameters did they use?

Also exclude your launcher from the equation. In the same environment if you run runscanner directly from the command line and launch a2cmd does it work or fail in the same way?

What are you trying to achieve with the string.format? The second parameter is a substitution parameter but I don't see anything like {0} in the first parameter.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users