Portable Apps

Discussion in 'Scripting' started by bundyal, Jan 13, 2020.

  1. bundyal

    bundyal MDL Junior Member

    Jun 28, 2014
    85
    76
    0
    Hi, who can help me.
    I have a whole folder with portable apps with a lot of folders in this place,
    D: \ PortableApps
    Now I want to make my 20 apps shortcuts in the root of D: \ PortableApps
    But I also want to be able to put the folder with apps and shortcuts on my USB stick or on another hard drive, but then the shortcuts will of course no longer work.
    Who has the script with the right rule that I have to change in every shortcut, or in a .bat file, then I can make an .exe of that .bat.
    Thanks in advance.
     
  2. Windows_Addict

    Windows_Addict MDL Expert

    Jul 19, 2018
    1,251
    3,440
    60
    #2 Windows_Addict, Jan 13, 2020
    Last edited: Jan 13, 2020
    For example,

    save it as .cmd
    Code:
    start "" "HWiNFOPortable\HWiNFOPortable.exe"
    where the structure of the folder is something like this,

    Code:
    start.cmd
    HWiNFOPortable\HWiNFOPortable.exe
    
    edit -

    You may also try following if you want to start the program as admin but it would not work if pathname contains certain special characters.

    Code:
    start "" "%~dp0HWiNFOPortable\HWiNFOPortable.exe"
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. bundyal

    bundyal MDL Junior Member

    Jun 28, 2014
    85
    76
    0
    Can i save this rule as a .bat file. And convert the .bat to .exe
     
  4. Windows_Addict

    Windows_Addict MDL Expert

    Jul 19, 2018
    1,251
    3,440
    60
    You can, but why would you want that?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. bundyal

    bundyal MDL Junior Member

    Jun 28, 2014
    85
    76
    0
    You say, save it as .cmd
    Must i make than for all my apps .cnd files ?
    Can i not change the rule in my shortcuts.
     
  6. bundyal

    bundyal MDL Junior Member

    Jun 28, 2014
    85
    76
    0
    #6 bundyal, Jan 13, 2020
    Last edited: Jan 14, 2020
    (OP)
    This line works.
    start "" "%~dp0Abylon SHREDDER Private 18.30.12.2\SAWipe\SAWipeX64.exe"

    Thank you very much for your help Windows_Addict
     
  7. Windows_Addict

    Windows_Addict MDL Expert

    Jul 19, 2018
    1,251
    3,440
    60
    I tried to do it with the shortcut file method but I failed in my few tests, maybe it can be done, I'm not sure, however editing shortcut file and editing .cmd file would require almost same level of work so I guess .cmd method is good enough.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. bundyal

    bundyal MDL Junior Member

    Jun 28, 2014
    85
    76
    0
    1 question.
    How to run Batch Files silently in background mode and hide the Console ?

    start "" "%~dp0Amazing DVD Creator 11.8.0\Free DVD Creator\Free DVD Creator.exe"
     
  9. Windows_Addict

    Windows_Addict MDL Expert

    Jul 19, 2018
    1,251
    3,440
    60
    To completely hide .cmd file console, you need a separate .vbs file or 3rd party tool, or you may try .bat to .exe programs, they have features to make it hidden.
    however, in your requirement, IMO it's overkill, the mentioned command console window appears for less than one second anyway.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. boyonthebus

    boyonthebus MDL Expert

    Sep 16, 2018
    1,168
    752
    60
    Open notepad, paste in code below, and save as .vbs.
    Code:
    Dim WinScriptHost
    Set WinScriptHost = CreateObject("WScript.Shell")
    WinScriptHost.Run Chr(34) & "path-to-batch-file" & Chr(34), 0
    Set WinScriptHost = Nothing
    Then, for your shortcut you need to set the target as
    Code:
    C:\Windows\System32\wscript.exe path-to-the-vbs-file
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. bundyal

    bundyal MDL Junior Member

    Jun 28, 2014
    85
    76
    0
    Thanks for all the responses, I have found the best solution.
    I am now using Bat To Exe Converter, I can turn it into an .exe, add an icon and I can hide the Console.
    Thank you all again.
     
  12. kaljukass

    kaljukass MDL Guru

    Nov 26, 2012
    3,396
    1,322
    120
    Each antivirus and antimalware will block your .bat to .exe generated .exe file as soon as possible because this code generator uses non-secure code.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. bundyal

    bundyal MDL Junior Member

    Jun 28, 2014
    85
    76
    0
    kaljukass
    And how can I solve that?
    You may know another program.
     
  14. kaljukass

    kaljukass MDL Guru

    Nov 26, 2012
    3,396
    1,322
    120
    I do not have any good recommendations at the moment.
    And I do not know why they use such a script, it has been so for years. I think somebody definitely knows something better.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. Flipp3r

    Flipp3r MDL Expert

    Feb 11, 2009
    1,964
    907
    60
    Don't worry about it. If your anti-virus complains, just add your file as a exclusion & your fine...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...