Why dosent the script hide shortcut to .bat file

0

***--------------------------
LOGON.INK -> LOGON.BAT:
--------------------------***

@echo off

title En@rypted Passwords - Login

color 0B

taskkill /f /IM explorer.exe


*attrib +h login.ink* **(logon.bat i use .ink becuse i use icons)**    *

*attrib -h logout.ink* **(logout.bat i use .ink becuse i use icons)**    *

attrib -h Snapchat.txt

attrib -h Instagram.txt

attrib -h Google+.txt

attrib -h GMX.txt

tree C:\Program Files (x86)

cls

echo You'r now signed in.

start explorer

pause

start D:\

I have the opposite just for logoff.bat... I use it on a D:\ (Memory Stick)

Windows 10

Mathias

Posted 2017-06-29T20:40:45.140

Reputation: 1

1Is the link in the working directory of the script? Also, do you mean .lnk? – Regejok – 2017-06-29T22:03:19.030

How do i hide shorcuts? i can hide .txt and .bat. but i cannot hide the a .ink (shortcut) – Mathias – 2017-06-30T19:48:41.530

And what did you mean by "
Is the link in the working directory of the script? Also, do you mean .lnk? "? Did you mean if the shortcut works? if so yes, it opens the logon.bat and logoff.bat.
– Mathias – 2017-06-30T19:49:41.687

No, I mean "did you mean .lnk", as in the file extension for a shortcut/link. .ink is no standard file extension. The working or current directory (%cd%) is where the batch file operates. Either cd into the desired directory or use absolute paths. attrib +h short.lnk hides the file. – Regejok – 2017-06-30T20:59:53.613

Answers

0

Not sure what you do wrong, but the following works on Windows 10:

Batch file called "test.cmd" with a shortcut to it named "test.lnk":

attrib +h test.lnk && REM "hide file"
pause
attrib -h test.lnk && REM "unhide file"

It hides the shortcut, pauses and unhides the shortcut. This works both from the shortcut and the batch-file.

1 2 3

Klinghust

Posted 2017-06-29T20:40:45.140

Reputation: 537