Novice scripting - Extract a batch file to ProgramData with VB

Discussion in 'Scripting' started by SwampFox56, Nov 26, 2014.

  1. Kamrul08

    Kamrul08 MDL Member

    Dec 28, 2013
    104
    13
    10
    Sorry for wrong mention. I assumed you reading your comments.
     
  2. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    Guide doggy was on patrol and thought this can be answered instantly :D. Check second of my posts directly above yours.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Kamrul08

    Kamrul08 MDL Member

    Dec 28, 2013
    104
    13
    10
    You are correct.
    I read your comments 12 and it works fine. But I was interested to batch. I explored Google and expended many times before to get the solution. But I didn't get. I faced Shell problem that you noted. So I asked the question?
     
  4. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    #24 s1ave77, Dec 3, 2014
    Last edited by a moderator: Apr 20, 2017
    Same trick in batch is a bit more difficult. While trying to shorten the task, OP also skipped the checks which assure the Explorer was killed completely befrore Windows restarts it. On admin account that shortening can cause the Explorer Window to open instead of the shell.

    You could either use the little EXE by hb860 or add a delay to the script to avoid the early restart.
    Add this line before the Explorer-Restart (value is waiting time in seconds):
    Code:
    timeout /t 10
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. SwampFox56

    SwampFox56 MDL Novice

    Aug 14, 2012
    47
    17
    0
    That's the issue I had with my VBScript. I had to specify in the script not to restart explorer until them next line of the script 'told' it to. BTW, here is my VBS wrapped in an EXE. ;)
     
  6. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    Already saw it ;). Had no intention to diss it :winkiss:.

    As stated for me the context menu is the preferred way (as one part of that actually bigger TOOLs menu). As always ... question of preferences.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Kamrul08

    Kamrul08 MDL Member

    Dec 28, 2013
    104
    13
    10
    #27 Kamrul08, Dec 4, 2014
    Last edited by a moderator: Apr 20, 2017
    Thanks. I'll try.