+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 21
Scripts Thread, I need vbs or batch file which can run number of .exe present within a folder. in Coding and Web Development; Hi, I need vbs or batch file which can run number of .exe present within a folder. For example the ...
  1. #1

    Join Date
    Apr 2013
    Posts
    32
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Post I need vbs or batch file which can run number of .exe present within a folder.

    Hi,

    I need vbs or batch file which can run number of .exe present within a folder.
    For example the all exe present in C:\AMB folder, the AMB folder contains many installable folders, and in that exe are present i.e. C:\AMB\installable\abc.exe ,C:\AMB\installable_1\abc.exe.

    All exe are having same naming convention. abc.exe

    Can someone please help me out in this project.

    Thanks in Advance!!!

  2. #2
    Grey-gear's Avatar
    Join Date
    Nov 2009
    Location
    Derby
    Posts
    483
    Thank Post
    36
    Thanked 64 Times in 50 Posts
    Rep Power
    25
    You would just need to have something like RUN ("C:\AMB\installable\abc.exe") for each exe you want to run.
    Last edited by Grey-gear; 2nd April 2013 at 09:14 AM.

  3. #3
    TechSupp's Avatar
    Join Date
    Mar 2007
    Location
    South Yorkshire
    Posts
    1,917
    Thank Post
    315
    Thanked 122 Times in 103 Posts
    Rep Power
    42
    Wouldnt you also need to set it to wait till one had finished before starting the next one.

  4. #4

    Join Date
    Apr 2013
    Posts
    32
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Hi Grey-gear,

    But i need to run each and every .exe whic is present inside C:\AMB\ folder.

    Actually i have a setup which ask a license file and then directory where to install, when this setup is completed.
    Then around 20 plugins which are executables (exe) needs to be installed inside the above ran setup.
    I want to do automation for this process.

    Can you please write such script?

    Thanks,

  5. #5

    Join Date
    Jan 2012
    Posts
    9
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Try this one....

    Quote Originally Posted by asifm View Post
    Hi Grey-gear,

    But i need to run each and every .exe whic is present inside C:\AMB\ folder.

    Actually i have a setup which ask a license file and then directory where to install, when this setup is completed.
    Then around 20 plugins which are executables (exe) needs to be installed inside the above ran setup.
    I want to do automation for this process.

    Can you please write such script?

    Thanks,
    Hi,

    Try this one.....


    '####### Start ######

    '# Run Exe Files in Specified folder and Subfolder
    '# Kevin Burke - 04-04-2013



    Set objFSO = CreateObject("Scripting.FileSystemObject")
    objStartFolder = "C:\AMB"

    Set objFolder = objFSO.GetFolder(objStartFolder)
    'Wscript.Echo objFolder.Path
    Set colFiles = objFolder.Files
    For Each objFile in colFiles
    'Wscript.Echo objFile.Name
    Next
    'Wscript.Echo

    ShowSubfolders objFSO.GetFolder(objStartFolder)

    Sub ShowSubFolders(Folder)
    For Each Subfolder in Folder.SubFolders
    'Wscript.Echo Subfolder.Path
    Set objFolder = objFSO.GetFolder(Subfolder.Path)
    Set colFiles = objFolder.Files
    Set objShell = WScript.CreateObject("WScript.Shell")
    For Each objFile in colFiles
    if instr(objFile.Name,".exe") then
    Wscript.Echo Subfolder.Path &"\"& objFile.Name
    objShell.Run objFile.Name, 1, true
    end if
    Next
    'Wscript.Echo
    ShowSubFolders Subfolder
    Next
    End Sub

    '#####End#####

  6. Thanks to kevvo2000 from:

    TechSupp (2nd April 2013)

  7. #6

    Join Date
    Apr 2013
    Posts
    32
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Hi Kevin,

    I think this code is written in java, can i have something same in commandline (batch file).

    Thanks.

  8. #7

    Join Date
    Apr 2013
    Posts
    32
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    I need script something like this one below;
    only the change i want is instead of giving each YepPIInstall.exe path i want to execute all the exe's at once which are in "C:\Plugins" directory.

    @echo off
    set /P _license file=License file path:
    set /P _directory=New Test Install Directory:

    cd\

    cd "C:\Plugins\AD_PLUGIN_INST"
    YepPIInstall.exe /qs C:\Test70.log /L "%_license file%" /d "%_directory%"

    cd "C:\Plugins\COMM_PLUGIN_INST"
    YepPIInstall.exe /qs C:\Test70.log /L "%_license file%" /d "%_directory%"


    cd "C:\Plugins\CORR_PLUGIN_INST"
    YepPIInstall.exe /qs C:\Test70.log /L "%_license file%" /d "%_directory%"

    IISRESET

  9. #8
    TechSupp's Avatar
    Join Date
    Mar 2007
    Location
    South Yorkshire
    Posts
    1,917
    Thank Post
    315
    Thanked 122 Times in 103 Posts
    Rep Power
    42
    Looks like vbs to me. Does the above wait for one to finish before starting the next as it could very well sort a similar thing for me that has just cropped up.

  10. #9
    SovietRussia's Avatar
    Join Date
    Mar 2013
    Location
    Powys, Wales
    Posts
    662
    Thank Post
    72
    Thanked 151 Times in 117 Posts
    Rep Power
    48
    Quote Originally Posted by asifm View Post
    Hi Kevin,

    I think this code is written in java, can i have something same in commandline (batch file).

    Thanks.
    That code is VBS

  11. #10
    TechSupp's Avatar
    Join Date
    Mar 2007
    Location
    South Yorkshire
    Posts
    1,917
    Thank Post
    315
    Thanked 122 Times in 103 Posts
    Rep Power
    42
    Ah! Just googled the run command and see you set the option to wait till finished, brilliant, thanks, job sorted for me anyway :-)

  12. #11

    Join Date
    Jan 2012
    Posts
    9
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Sorry, should be more specific.

    Quote Originally Posted by kevvo2000 View Post
    Hi,

    Try this one.....


    '####### Start ######

    '# Run Exe Files in Specified folder and Subfolder
    '# Kevin Burke - 04-04-2013



    Set objFSO = CreateObject("Scripting.FileSystemObject")
    objStartFolder = "C:\AMB"

    Set objFolder = objFSO.GetFolder(objStartFolder)
    'Wscript.Echo objFolder.Path
    Set colFiles = objFolder.Files
    For Each objFile in colFiles
    'Wscript.Echo objFile.Name
    Next
    'Wscript.Echo

    ShowSubfolders objFSO.GetFolder(objStartFolder)

    Sub ShowSubFolders(Folder)
    For Each Subfolder in Folder.SubFolders
    'Wscript.Echo Subfolder.Path
    Set objFolder = objFSO.GetFolder(Subfolder.Path)
    Set colFiles = objFolder.Files
    Set objShell = WScript.CreateObject("WScript.Shell")
    For Each objFile in colFiles
    if instr(objFile.Name,".exe") then
    Wscript.Echo Subfolder.Path &"\"& objFile.Name
    objShell.Run objFile.Name, 1, true
    end if
    Next
    'Wscript.Echo
    ShowSubFolders Subfolder
    Next
    End Sub

    '#####End#####
    Sorry, this is a VB Script, just save it as a .vbs file and it will run on any windows based PC.

    Cheers
    Kev.

  13. #12

    Join Date
    Jan 2012
    Posts
    9
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by TechSupp View Post
    Ah! Just googled the run command and see you set the option to wait till finished, brilliant, thanks, job sorted for me anyway :-)
    No Problem,

    Thanks
    Kev.

  14. #13

    Join Date
    Jul 2012
    Location
    Boerne Texas USA
    Posts
    45
    Thank Post
    0
    Thanked 9 Times in 9 Posts
    Rep Power
    6

    cmd or bat implementation

    run at command prompt.
    Code:
    for /f %a in ('dir /s /b C:\AMB\*.exe') do %a
    if you run this from a .BAT file, you will need two % for the variables
    Code:
    for /f %%a in ('dir /s /b C:\AMB\*.exe') do %%a

  15. Thanks to jklight from:

    asifm (3rd April 2013)

  16. #14

    Join Date
    Apr 2013
    Posts
    32
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Hi,

    for /f %%a in ('dir /s /b C:\AMB\*.exe') do %%a

    Can you please let me know how should we can set directory path for above script.

  17. #15

    Join Date
    Apr 2013
    Posts
    32
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by jklight View Post
    run at command prompt.
    Code:
    for /f %a in ('dir /s /b C:\AMB\*.exe') do %a
    if you run this from a .BAT file, you will need two % for the variables
    Code:
    for /f %%a in ('dir /s /b C:\AMB\*.exe') do %%a
    Hi jklight,

    The above code is perfect for me, but only thing is the executable asks for directory path where this should be installed eg: d:\Setup\xyz
    How can i set the path for this each .exe, all exe will go at same path.

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 7
    Last Post: 18th July 2012, 10:45 AM
  2. Replies: 14
    Last Post: 18th March 2012, 09:14 PM
  3. Replies: 4
    Last Post: 12th February 2012, 11:26 PM
  4. Need help with batch files please!
    By richrad_mills in forum Windows
    Replies: 13
    Last Post: 23rd June 2010, 07:24 PM
  5. Which do i need, Flash or Shockwave?
    By Quackers in forum Web Development
    Replies: 3
    Last Post: 28th June 2006, 04:55 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •