Update your Win 7 installation media

Page 22 of 144 FirstFirst ... 12202122232432122 ... LastLast

  1. Posts : 16,149
    7 X64
    Thread Starter
       #211

    Form:

    BROW <variable name>, [[* | &] initial path],[prompt text],[extension name],[notation]


    Examples:

    1. To select a File:

    BROW SOMEVARIABLE,Windows 7.iso,Some message Here,*.ISO|*.ISO|All|*.*||

    2. To select a folder

    BROW ANOTHERVARIABLE,*C:\Windows,Some Message Here


    3. To save a file

    BROW DIFFERENTVARIABLE,&Whateverx64.iso,Select Iso Destination SOME MESSAGE ,*.ISO|*.ISO||
    Last edited by SIW2; 09 Apr 2019 at 16:57.
      My Computers


  2. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
       #212

    Hi SIW2,

    SIW2 said:
    You can see for yourself by using this batch:

    Code:
    @echo off
    echo. &echo.
    echo Path of this batch is  %~dp0
    echo. &echo.
    SET TP=%~dp0
    echo The value of the variable TP is %TP%
    echo. &echo.
    SET TP=%TP:~0,-1%
    echo Now the value of the variable TP is %TP%
    echo. &echo.
    cd /d "%TP%"
    pause
    That's strange. I just used the logic in a batch file to run system specifications...

    Code:
    @echo off
    systeminfo > %~dp0\My_System_Specs.txt
    .. and it worked with the \ included!
      My Computer


  3. Posts : 16,149
    7 X64
    Thread Starter
       #213

    Your Getfolder.ini
    Code:
    ENVI TFOLDERPATH=d:\
    BROW TFOLDERPATH,,PLEASE BROWSE TO YOUR WINDOWS 7 INSTALLATION FILES,exe 
    EXEC =!CMD.EXE /C ECHO set folderpath="%TFOLDERPATH%">"%CurDir%\setfolderpath.cmd"
    ENVI TFOLDERPATH=
    Try this:

    BROW TFOLDERPATH,*, PLEASE BROWSE TO YOUR WINDOWS 7 INSTALLATION FILES FOLDER
      My Computers


  4. Posts : 16,149
    7 X64
    Thread Starter
       #214

    .. and it worked with the \ included!
    Yes, it does. It seems to work in that case even though there are two \\.
      My Computers


  5. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
       #215

    Hi SIW2,

    SIW2 said:
    Yes, it does. It seems to work in that case even though there are two \\
    I checked and the two \\ don't actually appear and don't seem to have an affect because the .txt file gets created successfully with the correct information!

    Thanks for replying.
      My Computer


  6. Posts : 16,149
    7 X64
    Thread Starter
       #216

    Try it without \ like this:

    Code:
    @echo off
    systeminfo > %~dp0My_System_Specs.txt
    I checked and the two \\ don't actually appear
    Where are you expecting the \\ to appear?

    If you echo it you will see them

    echo %~dp0\My_System_Specs.txt

    Update your Win 7 installation media-2019-04-09_232919.jpg

    Some things work OK with \\ for example 7zip seems to handle it fine, but not everything does.
      My Computers


  7. Posts : 7,351
    Windows 7 HP 64
       #217

    SIW2 said:
    1. The %~dp0 variable in a batch file will expand to the drive letter and path of that batch file.

    If the batch is on my desktop %~dp0 returns this:

    C:\Users\SIW2\Desktop\


    2. SET TP =%~dp0

    Means set TP to the drive letter and path of the batch file ( TP is the variable which i use to express This Path) OK

    3. SET TP=%TP:~0,-1%

    means remove the last character from %TP%. It removes the backslash.
    ~0,-1 means last character minus 1?

    So now if you echo the variable %TP%, it returns this:

    C:\Users\SIW2\Desktop

    4. cd /d "%TP%"
    OK

    Means change directory to TP (this path)
    Thanks
      My Computers


  8. Posts : 7,351
    Windows 7 HP 64
       #218

    SIW2 said:
    Your Getfolder.ini
    Code:
    ENVI TFOLDERPATH=d:\
    BROW TFOLDERPATH,,PLEASE BROWSE TO YOUR WINDOWS 7 INSTALLATION FILES,exe 
    EXEC =!CMD.EXE /C ECHO set folderpath="%TFOLDERPATH%">"%CurDir%\setfolderpath.cmd"
    ENVI TFOLDERPATH=
    Try this:

    BROW TFOLDERPATH,*, PLEASE BROWSE TO YOUR WINDOWS 7 INSTALLATION FILES FOLDER
    Thanks a LOT
      My Computers


  9. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
       #219

    Hi SIW2,

    SIW2 said:
    Try it without \ like this:

    Code:
    @echo off
    systeminfo > %~dp0My_System_Specs.txt
    Where are you expecting the \\ to appear?

    If you echo it you will see them

    echo %~dp0\My_System_Specs.txt

    Update your Win 7 installation media-2019-04-09_232919.jpg

    Some things work OK with \\ for example 7zip seems to handle it fine, but not everything does.
    I did try systeminfo > %~dp0My_System_Specs.txt [I should have said] and it did also work.
      My Computer


  10. Posts : 16,149
    7 X64
    Thread Starter
       #220

    I already said it I know that works. But if you echo it as in my post,

    echo %~dp0\My_System_Specs.txt
    you will see there are two \\.

    \\ is OK for some applications, but not for all.

    Some things work OK with \\ for example 7zip seems to handle it fine, but not everything does.
    That is why it is common practice to remove the \ from %~dp0
      My Computers


 
Page 22 of 144 FirstFirst ... 12202122232432122 ... LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:40.
Find Us