Jump to content











Photo
- - - - -

Need to create shortcuts from multiple exe on different subfolders


  • Please log in to reply
27 replies to this topic

#26 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15194 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 24 March 2012 - 07:34 PM

That works. Thanks!

Good. :)

How can you put a space in between

From
Game 1-Eternal Daughter

to
Game 1 - Eternal Daughter


The hyphen in

Game 1-Eternal Daughter

is the hyphen here:

Shortcut.exe /F:"%~d0!Folder_name!-%%~nA.lnk" /I:"%%~dpnxA",0 /R:1 /T:"%%~dpnxA" /A:C /W:"%%~dpA


;)

:cheers:
Wonko

#27 TheHive

TheHive

    Platinum Member

  • .script developer
  • 4171 posts

Posted 24 March 2012 - 07:38 PM

Excellent! Putting a space in between did the trick.
Thanks!


@ECHO OFF

SETLOCAL ENABLEEXTENSIONS

SETLOCAL ENABLEDELAYEDEXPANSION

FOR /F "tokens=* delims=" %%A IN ('dir /b /s *.exe') DO (

ECHO %%~dpnxA

CALL :Get_Folder "%%~pA"

Shortcut.exe /F:"%~d0!Folder_name! - %%~nA.lnk" /I:"%%~dpnxA",0 /R:1 /T:"%%~dpnxA" /A:C /W:"%%~dpA

)

GOTO :EOF

:Get_Folder

SET Folder_Name=

FOR /F "tokens=1,2,3,4,5 delims=" %%B IN (%1) DO (

SET Folder_Name=%%F

IF NOT DEFINED Folder_Name SET Folder_Name=%%E

IF NOT DEFINED Folder_Name SET Folder_Name=%%D

IF NOT DEFINED Folder_Name SET Folder_Name=%%C

IF NOT DEFINED Folder_Name SET Folder_Name=%%B

)

GOTO :EOF



#28 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15194 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 25 March 2012 - 12:08 PM

Good. :)
You owe me a virtual beer. ;)

:cheers:
Wonko




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users