Any possibility to write attributes through a script?
There is the possibility to use the "run"-command with the windows-attrib-command, but it produces nasty terminal-windows.
I need to change the attribute to create a folder with a custom icon through a script. (folder needs attrib +r or +s to parse the desktop.ini, and the desktop.ini gets +h)
Scripting Command: attrib
Scripting Command: attrib
Operating System: Win10 x64 / Win11 x64 / almost allways newest XY-beta
totally XYscripting-addicted
totally XYscripting-addicted
Re: Scripting Command: attrib
Bumping on this.
As far as I can see there's no such a thing yet available for us to play with. Is it time?
As far as I can see there's no such a thing yet available for us to play with. Is it time?
Power-hungry user!!!
-
admin
- Site Admin
- Posts: 65338
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Scripting Command: attrib
No.tiago wrote:Bumping on this.
As far as I can see there's no such a thing yet available for us to play with. Is it time?
FAQ | XY News RSS | XY X
Re: Scripting Command: attrib
We can use every dos command by using smtg like this:
run "%comspec% /c attrib +s c:\temp\file name.ext";
This will show an DOS-Box for an second.
To hide the DOS-Box (terminal window) there are several small stand alone tools
like HideDos.exe or Autohotkey or AutoIt or VBS scripts. (But i don't know right now how to hide internal commands like attrib)
But we can use an VBScript like this:
comspec.vbs
and use this like:
run "<xypath>\comspec.vbs" "attrib +r -s -h c:\temp\name.ext";
This will not show any window.
(If the default action of vbscript on your box is show in notepadinstead of executing use
run "cScript <xypath>\comspec.vbs" "attrib +r -s -h c:\temp\name.ext";
-
Or simple create an shortcut to windows\cmd.exe into your XYplorer folder: cmd.exe.lnk
then modify the link property to run minimized
and use this as:
run "<xypath>\cmd.exe.lnk /c attrib +s +h c:\temp\file name.ext";
This will only show an taskbar icon for an second.
run "%comspec% /c attrib +s c:\temp\file name.ext";
This will show an DOS-Box for an second.
To hide the DOS-Box (terminal window) there are several small stand alone tools
like HideDos.exe or Autohotkey or AutoIt or VBS scripts. (But i don't know right now how to hide internal commands like attrib)
But we can use an VBScript like this:
comspec.vbs
Code: Select all
If WScript.Arguments.Count <> 1 Then Wscript.Quit
command = WScript.Arguments(0)
CreateObject("WScript.Shell").Run "%comspec% /c " & chr(34) & command & chr(34), 0, True
run "<xypath>\comspec.vbs" "attrib +r -s -h c:\temp\name.ext";
This will not show any window.
(If the default action of vbscript on your box is show in notepadinstead of executing use
run "cScript <xypath>\comspec.vbs" "attrib +r -s -h c:\temp\name.ext";
-
Or simple create an shortcut to windows\cmd.exe into your XYplorer folder: cmd.exe.lnk
then modify the link property to run minimized
and use this as:
run "<xypath>\cmd.exe.lnk /c attrib +s +h c:\temp\file name.ext";
This will only show an taskbar icon for an second.
XYplorer Beta Club