Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Batch file help needed

    i have some code for a batch file i and if i open command prompt and past all the lines in it works but if i add the code to a file and click the install.bat it doesn't work

    @ECHO OFF
    set w=s
    for /d %x in ( A B 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 %x:\Software\App\Setup.exe
    set w=%x
    %w%:\Software\App\Setup.exe

    How Can I Get That To execute when i double click on the Install.bat

    right now the command prompt window just opens and close's
    Last edited by cworkman29729; 12-02-2008 at 01:18 PM.

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    If you want to launch that process you need to use the start command. See my thread on writing a batch file to launch a process:
    http://www.codingforums.com/showthre...ighlight=batch
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    oh i forgot to update the post

    i change it to this

    set w=s
    C:\WinXP\XPCDTOOLS\miso.exe NULL -mnt 1 "C:\WinXP\WinXP9-in-1.iso"

    pause

    COPY C:\VRMPVO~1.ISO "C:\WinXP" /Y /V
    DEL "C:\VRMPVOL_EN.ISO"

    C:\WinXP\XPCDTOOLS\miso.exe NULL -mnt 1 "C:\WinXP\VRMPVO~1.ISO"

    for /d %x in ( A B 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 %x:\WIN51IP.SP2 set w=%x

    XCOPY %w%:\ "C:\WinXP\XPCD" /Y /H /E

    but its still not working

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    when using the for statement in a batch file, you have to use a double percent sign in the varname:
    for /d %%x in .......
    I am the luckiest man in the world

  • Users who have thanked Roelf for this post:

    cworkman29729 (12-02-2008)

  • #5
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Roelf View Post
    when using the for statement in a batch file, you have to use a double percent sign in the varname:
    for /d %%x in .......
    Thanks Its Working Now!

  • #6
    Regular Coder
    Join Date
    Nov 2007
    Location
    Leeds, UK
    Posts
    514
    Thanks
    24
    Thanked 19 Times in 19 Posts
    Quote Originally Posted by cworkman29729 View Post
    Thanks Its Working Now!
    This is correct but it is better coding to do %x%
    Working towards a Internet where we don't have website just browser applications Kill the Hyper-link and say hello to 3D Games in the browser :)


  •  

    Posting Permissions

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