Batch file execution in Home edition

Discussion in 'General Discussion' started by Shreenivas Potnis, Jul 12, 2017.

  1. Shreenivas Potnis

    Shreenivas Potnis

    Joined:
    Jul 6, 2017
    Messages:
    8
    Likes Received:
    0
    In WINDOWS 7 Professional a batch file executes commands synchronously (i.e. it waits for the 1st command to complete before executing the next one).
    I want know, whether it works in the same manner in the Home edition too?
     
    Shreenivas Potnis, Jul 12, 2017
    #1
    1. Advertisements

  2. Shreenivas Potnis

    Ian Administrator

    Joined:
    Oct 17, 2008
    Messages:
    3,444
    Likes Received:
    630
    Hi Shreenivas, yes it's the same in both editions :). Batch files will always run like that.
     
    Ian, Jul 12, 2017
    #2
    1. Advertisements

  3. Shreenivas Potnis

    Shreenivas Potnis

    Joined:
    Jul 6, 2017
    Messages:
    8
    Likes Received:
    0
    This difference in behavior was noticed in XP-Home and XP-Professional, hence the question. Have you actually checked it in Windows 7 Home?
     
    Shreenivas Potnis, Jul 12, 2017
    #3
  4. Shreenivas Potnis

    TrainableMan ^ The World's First ^ Moderator

    Joined:
    May 10, 2010
    Messages:
    9,078
    Likes Received:
    1,586
    Location:
    PA, USA
    It's how batch files work, the edition makes no difference. I don't know what you think was different in XP but it wasn't because of the batch instruction's execution.
     
    TrainableMan, Jul 13, 2017
    #4
  5. Shreenivas Potnis

    Shreenivas Potnis

    Joined:
    Jul 6, 2017
    Messages:
    8
    Likes Received:
    0
    Consider the following batch file:
    ..............
    md ABCD
    Notepad
    rd ABCD
    ..............
    I noticed that in Professional the folder ABCD was removed only after Notepad was closed, while in Home the folder was removed even when the Notepad was still open.
     
    Shreenivas Potnis, Jul 13, 2017
    #5
  6. Shreenivas Potnis

    clifford_cooley VIP Member

    Joined:
    Mar 8, 2009
    Messages:
    5,031
    Likes Received:
    1,192
    I've played around in command-line scripts for many years. And if I ever wanted command-line script to continue running while another command was continuing to process, I had to intentionally "start" the command in a separate window.

    c:\start /?
     
    clifford_cooley, Jul 13, 2017
    #6
  7. Shreenivas Potnis

    Shreenivas Potnis

    Joined:
    Jul 6, 2017
    Messages:
    8
    Likes Received:
    0
    True. I am aware of that but my requirement is exactly the opposite. I want the batch file not remove the folder till the Notepad is not closed. Surprisingly, that was not happening in the Home edition of XP, hence wanted to know whether the behavior was rectified in WINDOWS 7 Home edition.
     
    Shreenivas Potnis, Jul 13, 2017
    #7
  8. Shreenivas Potnis

    Ian Administrator

    Joined:
    Oct 17, 2008
    Messages:
    3,444
    Likes Received:
    630
    I've not run this to confirm as I don't use the home edition, but I've never seen a batch file run things asynchronously - when I've wanted to do that, I've had to explicitly "start" things like @clifford_cooley mentioned.

    I don't think the problem you've experienced is to do with how batch files work, but how notepad runs. Your code does the following:
    1. Creates a directory
    2. Launches Notepad.exe.... but this isn't run within the cmd prompt so may or may not wait until the application has finished until continuing, depending on how the process was launched.
    3. Deletes the directory
    Try modifying your code to do the following, as this will wait until notepad.exe has closed before continuing:

    Code:
    md ABCD
    start /wait notepad.exe
    rd ABCD
    
     
    Ian, Jul 13, 2017
    #8
    TrainableMan and clifford_cooley like this.
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Al Dykes

    Is file and print sharing in W7/home like XP/home?

    Al Dykes, Dec 14, 2009, in forum: alt.windows7.general
    Replies:
    1
    Views:
    1,457
  2. wittgenstein

    SOLVED Windows 7 64bit or Home edition

    wittgenstein, Apr 20, 2010, in forum: Installation, Setup and Updates
    Replies:
    4
    Views:
    2,169
    catilley1092
    Apr 21, 2010
  3. ravindra.pc
    Replies:
    10
    Views:
    11,206
  4. Buffalo

    Best Help Guides for Win 7 Home Edition

    Buffalo, Aug 11, 2011, in forum: alt.windows7.general
    Replies:
    22
    Views:
    1,821
    J. P. Gilliver (John)
    Aug 13, 2011
  5. ECLiPSE 2002

    Cannot locate Windows Explorer in Home Edition- please help

    ECLiPSE 2002, Nov 29, 2011, in forum: alt.windows7.general
    Replies:
    18
    Views:
    911
    J. P. Gilliver (John)
    Dec 3, 2011
  6. yhkim1211
    Replies:
    6
    Views:
    2,317
    yhkim1211
    Jan 11, 2012
  7. clifford_cooley

    EaseUS Partition Master Home Edition

    clifford_cooley, May 15, 2012, in forum: Free Software Database
    Replies:
    0
    Views:
    2,803
    clifford_cooley
    May 15, 2012
  8. Just Judy
    Replies:
    5
    Views:
    1,470
    Phantom Post
    Dec 10, 2012
Loading...