Ghost Solution Suite

 View Only
Expand all | Collapse all

Start.Bat isn't running

  • 1.  Start.Bat isn't running

    Posted Mar 14, 2012 03:48 PM

    I am trying to automate an image with an ISO. If I paste the contents of start.bat dorectly into the WinPE command prompt the automation works, but it wont start on its own.

    Here is what the start.bat consists of:

    @echo off
    Rem – scan for a file in the root of the DVD called brdell.GHO and set system variable %DVD%
    for %f 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 %f:\brdell.GHO set DVD=%f:
    x:
    cd \ghost
    Ghost32 -clone,mode=restore,src=%DVD%\brdell.GHO,dst=1 -sure -rb

     

    Basically, what it does is this

    X:\windows\system32\echo off

    (pauses here for a bit)

    X:\windows\system32\

     

    Is there something i am doing wrong? I need this to start on it's own
     



  • 2.  RE: Start.Bat isn't running

    Posted Mar 14, 2012 05:46 PM

    What exactly do you mean you paste the contents of start.bat directly into the WinPE command prompt?

    If it does not run from start.bat within WinPE, first of all check that the start.bat in your WinPE environment has the correct code in it.

    Then take out the @echo off command so that you can see exactly what is going on.

    Then add a line:  echo %DVD%   to check that the correct drive letter is being located.

    Stick a few pauses in - right at the beginning as well, so that you can give it a few seconds before you run the batch file code.

    So something like this:

    echo "This is Start.bat"
    pause
    Rem – scan for a file in the root of the DVD called brdell.GHO and set system variable %DVD%
    for %f 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 %f:\brdell.GHO set DVD=%f:
    echo %DVD%

    pause
    x:

    cd \ghost
    Ghost32.exe -clone,mode=restore,src=%DVD%\brdell.GHO,dst=1 -sure -rb

    Once you have figured out what is going on, you can fix any code issues and then clean up the debug additions and make it a lot tidier again.



  • 3.  RE: Start.Bat isn't running

    Posted Mar 15, 2012 08:52 AM

    I built the winpe environment just from the ghost boot wizard... what code would there?



  • 4.  RE: Start.Bat isn't running

    Posted Mar 15, 2012 09:22 AM

    >What code would there?

    Sorry, I don't understand what you are asking.



  • 5.  RE: Start.Bat isn't running

    Posted Mar 18, 2012 10:48 AM

    I also need help!!!

     

    I am trying to automate an image with an ISO.

    need a command line to use as I will be restoring it by cd/dvd rom,

    As Cd/dvd rom always change Drive letter so I am not able to use below mentioned script.

     

    set path=%path%;x:\ghost

    x:
    cd \ghost
    rem --- This will create primary OS drive configuration ---
    ghost32.exe /setosdrives /blind >> x:\ghost\startlog.txt
    start ghost32.exe -clone,mode=load,src=c:IMAGE.GHO,dst=1:1 -sure

    It works if cd/dvd drive takes drive letter c:

    Please help ASAP.



  • 6.  RE: Start.Bat isn't running

    Posted Mar 18, 2012 06:16 PM

    @sahil848

    It is unnecessary to send me emails and personal messages through Connect - especially as the answer to your question is in my first posting in this thread. Please read and understand the batch code in this posting before you post any more questions, as if you still need further help, we will need to know why this code is not applicable to your situation.



  • 7.  RE: Start.Bat isn't running

    Posted Mar 19, 2012 03:53 PM

    i ended up putting calls to scripts, etc in the startnet.cmd file.  i found this works



  • 8.  RE: Start.Bat isn't running

    Posted Mar 19, 2012 04:14 PM

    Can you please help me with the steps.

    I have checked the steps by removing @echo off

    Used @echo %dvd%   reply was %dvd%

    after that I used command mentioned in forum, it stops at console where I have to manually select the .Gho file to restore it.



  • 9.  RE: Start.Bat isn't running

    Posted Mar 20, 2012 06:07 AM

    OK, I've just noticed a minor bug in the code pasted earlier - something removed one of the % symbols in each location:

    Try this:

     

    for %%f 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 %%f:\brdell.GHO set DVD=%%f
     
    echo %DVD%
    pause
     
    Note that I have not put a random : after the set DVD=%%f
    So later in your Ghost line you need to include the :
    eg:
    Ghost32.exe -clone,mode=restore,src=%DVD%:\brdell.GHO,dst=1 -sure -rb
     
     
    This location may be of reference help: http://ss64.com/nt/for_f.html


  • 10.  RE: Start.Bat isn't running

    Posted Mar 22, 2012 09:05 AM

    I probably should have clarified that i edit the startnet.cmd file for PE images i make OUTSIDE of GSS.  I have not tried it in GSS PEs.  Though try Ed's suggestions below with the ever so slightly changed code.



  • 11.  RE: Start.Bat isn't running

    Posted Mar 25, 2012 03:29 AM

    Hi All,

     

    I have checked this one now

    @echo
    Rem – scan for a file in the root of the DVD called brdell.GHO and set system variable %DVD%
    for %f 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 %f:\IMAGE.GHO set DVD=%f:
    x:
    cd \ghost
    Ghost32 -clone,mode=restore,src=%DVD%\IMAGE.GHO,dst=1:1 -sure -rb

     

    Basically, what it does is this

    X:\windows\system32>echo off

    (pauses here for a bit)

    X:\windows\system32>



  • 12.  RE: Start.Bat isn't running

    Posted Mar 26, 2012 03:31 AM

    Your posting has %f instead of %%f - you need to have two percentage signs, not one. I'm not sure if the forum software is removing one instance when you paste, or you have missed this in your coding. I have tested this code on my system and it works fine, so I'm sure you can get this working on yours also.



  • 13.  RE: Start.Bat isn't running

    Posted Mar 26, 2012 09:27 AM

    So if I am corect you want me to use

    @echo
    Rem – scan for a file in the root of the DVD called brdell.GHO and set system variable %DVD%
    for %%f 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 %f:\IMAGE.GHO set DVD=%f:
    x:
    cd \ghost
    Ghost32 -clone,mode=restore,src=%DVD%\IMAGE.GHO,dst=1:1 -sure -rb

     

    Let me know if I still need to make any changes.



  • 14.  RE: Start.Bat isn't running

    Posted Mar 26, 2012 11:17 AM

    At the end of your "for" line, you still have: ...set DVD=%f: instead of %%f:



  • 15.  RE: Start.Bat isn't running

    Posted Mar 26, 2012 03:04 PM

    If I am correct you want me to use code as mentioned below.

     

    @echo
    Rem – scan for a file in the root of the DVD called brdell.GHO and set system variable %DVD%
    for %%f 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 %f:\IMAGE.GHO set DVD=%%f:
    x:
    cd \ghost
    Ghost32 -clone,mode=restore,src=%DVD%\IMAGE.GHO,dst=1:1 -sure -rb

     

    If it still needs correction will request you to please mention the compleate code.

    which will really help me.



  • 16.  RE: Start.Bat isn't running

    Posted Mar 27, 2012 07:25 AM

    Corrected again, as a previously correct entry was now incorrect:

    @echo
    Rem – scan for a file in the root of the DVD called brdell.GHO and set system variable %DVD%
    for %%f 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 %%f:\IMAGE.GHO set DVD=%%f:
    x:
    cd \ghost
    Ghost32 -clone,mode=restore,src=%DVD%\IMAGE.GHO,dst=1:1 -sure -rb