How to do these permission granting commands in Windows Explorer? - iis

In this tutorial, I found the following commands.
ICACLS "%SystemDrive%\Windows\System32\inetsrv\config" /Grant "Network Service":R /T
ICACLS "%SystemDrive%\Windows\System32\inetsrv\config\administration.config" /Grant "Network Service":R
ICACLS "%SystemDrive%\Windows\System32\inetsrv\config\redirection.config" /Grant "Network Service":R
How to do these using Windows Explorer?
What does the /T mean?

ICACLS is a command line tool. You need to use the comand line.
/T performs the operation on all specified files in the current directory and its subdirectories. http://msdn.microsoft.com/library/cc753525(v=WS.10).aspx

Related

ctags.exe & etags.exe return Permission denied

I have ctags.exe and etags.exe installed via scoop installer and emacs app.
No matter how I run it, I always get a Permission denied error output.
Whether with CMD user or admin permissions (elevated permissions thing).
tomas#NUC8I7HVK D:\playground\c\milton\src
# ctags.exe .
.: Permission denied
$ C:\Users\tomas\scoop\apps\emacs\current\bin\ctags.exe .
.: Permission denied
This is the version used:
# ctags.exe -V
ctags (GNU Emacs 26.2)
Copyright (C) 2019 Free Software Foundation, Inc.
This program is distributed under the terms in ETAGS.README
I would say this is a Windows 10 thing, though I haven't found any help online.
Windows 10 64-bit
You did not say the tags file failed to be generated.
"You may see messages like "Warning: cannot open source file '...' : Permission denied" while etags is building the tags file. These warnings can be ignored."
How to use ctags
ctags.exe included on Emacs for Windows does not work for me.
I tried universal-ctags, which does work.
tomas#NUC8I7HVK D:\playground\c\milton\src
$ scoop search ctags
'extras' bucket:
emacs (26.3) --> includes 'ctags.exe'
universal-ctags (2020-03-12)
'main' bucket:
ctags (5.8)
tomas#NUC8I7HVK D:\playground\c\milton\src
$ scoop search universal-ctags
I found a work around for using etags on directory trees that you might interested in. You can run a for loop and use the -a flag to append to the TAGS file like so:
for /r %y in (*.c) do etags -a %y
The /r option in the for loop will execute the for loop in each directory of the tree.
You can also make a bat script:
for /r %%y in (*.c) do etags -a %%y
for /r %%y in (*.h) do etags -a %%y

How do I delete node_modules folder quickly?

When I want to delete a node_modules folder it takes ages when I delete it using Windows Explorer. How do I delete faster?
I use to have the same issue, taking hours to achieve the deletion until I found this workaround:
Select the node_modules folder. Do this with the file explorer.
Open Powershell as admin: press Alt+F, then S, then A.
Wait and accept to open Powershell as admin
Paste this command and press Enter: del /f/q/s *.* > nul.
WARNING
Please be sure to be in the folder node_modules. I mean, that the terminal path ends with ...\node_modules.
In the above command, we use the /f switch to force the deletion of read-only files. The /q switch enables quiet mode. The /s switch executes the command for all files in any folder inside the folder you’re trying to remove. Using *.* tells the del command to delete every file and > nul disables the console output improving performance and speed.
Wait for the process to take action.
Now go up one level in the directory with cd...
Finally use this command to delete the node_modules folder rmdir /q/s node_modules
In the above command, we use the /q switch to enable quiet mode, the /s switch to run the command on all the folders, and node_modules is the variable you need to specify to delete the folder you want.
If you get an error with Powershell try other terminals as administrator like Windows Terminal, Command Prompt (cmd) or third party terminals like ConEmu. I made this steps with Cmder and all the deletion was done in just 5 minutes. Off course this duration is variable according to the size of the folder.
References:
pureinfotech.com
ConEmu
Cmder
From you project folder use following command to delete it:
rd .\node_modules\ /s /q

Runas a certain xls file

I need to write a batch script which opens a certain xls file on behalf of another user account.
runas separately works OK:
runas /profile /user:username "C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE"
excel connector is also OK:
"C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE /r C:\fol der\file.xls"
but together it's not:
runas /profile /user:username "C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE /r C:\fol der\file.xls"
It can't handle the path of the xls file if there is space anywhere.
As per RUNAS - Execute a program under a different user account: RUNAS used backslash \ as an escape character (not the standard ^ used by other CMD commands). Moreover, runas /? gives next example literally:
runas /env /user:user#domain.microsoft.com "notepad \"my file.txt\""
Hence, your line should be as follows:
runas /profile /user:username "\"C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE\" /r \"C:\fol der\file.xls\""

Windows 'move' command's /y not overriding destiation file, failing with an error: file already exists

In wine and wineconsole when I try and move a file with the following command:
move /Y "file" "destination" I get the following error:
File already exists
and the file is not replaced. According to the windows help page http://technet.microsoft.com/en-us/library/bb490935.aspx /y should suppress the prompt asking if you wish to override the file, which it does, and also overwrite the file, which it fails at.
If I don't use /y it prompts me, after responding yes the file is overwritten. Can someone confirm the move command with /y is broken in wine (v1.6) and if so offer any suggestions while still using the move command.
As a temporary fix I perform a del /f/q on the destination before I move the file.

The command xcopy ... exited with code 9009 in Visual Studio

When I build my solution with 10 Projects I get Build failures for 7 projects. All 10 Projects have post-build events. Even those who build use an xcopy command. I say this because my colleague was the opinion VS 2012 and xcopy is not that good...
These 7 build failures did not happen before.
The following error happens when I try to build the project or "from time to time" when I start my Visual Studio.
I get this error:
Error 1 The command "xcopy /y "D:\Replaced\branches\ReplacedTest\Swan.Replaced.Mobile.Web\Client" "D:\Replaced\branches\ReplacedTest\build\web\bin\..\Client\" /s /e /v
xcopy /y "D:\Replaced\branches\ReplacedTest\Swan.Replaced.Mobile.Web\Content" "D:\Replaced\branches\ReplacedTest\build\web\bin\..\Content\" /s /e /v
xcopy /y "D:\Replaced\branches\ReplacedTest\Swan.Replaced.Mobile.Web\Views" "D:\Replaced\branches\ReplacedTest\build\web\bin\..\Views\" /s /e /v
xcopy /y "D:\Replaced\branches\ReplacedTest\Swan.Replaced.Mobile.Web\web.config" "D:\Replaced\branches\ReplacedTest\build\web\bin\..\"
xcopy /y "D:\Replaced\branches\ReplacedTest\Swan.Replaced.Mobile.Web\global.asax" "D:\Replaced\branches\ReplacedTest\build\web\bin\..\"
xcopy /y "D:\Replaced\branches\ReplacedTest\Swan.Replaced.Mobile.Web\Tools" "D:\Replaced\branches\ReplacedTest\build\web\bin\..\..\Tools\" /s /e /v
" exited with code 9009. Swan.Replaced.Mobile.Web
I have googled a lot on SO and the main cause for this problem seem to be:
1.) A whitespace in the path/folder name
2.) The command does not get full paths
3.) Maybe some environment/system variables problem?
I can not see this error in my post-build event:
xcopy /y "$(ProjectDir)Client" "$(TargetDir)..\Client\" /s /e /v
xcopy /y "$(ProjectDir)Content" "$(TargetDir)..\Content\" /s /e /v
xcopy /y "$(ProjectDir)Views" "$(TargetDir)..\Views\" /s /e /v
xcopy /y "$(ProjectDir)web.config" "$(TargetDir)..\"
xcopy /y "$(ProjectDir)global.asax" "$(TargetDir)..\"
xcopy /y "$(ProjectDir)Tools" "$(TargetDir)..\..\Tools\" /s /e /v
My TargetDir is this outputpath:
..\build\web\bin\
My ProjectDir is this:
D:\Replaced\branches\ReplacedTest
comment: When I use xcopy on the console window thats totally fine.
These are my specs:
Windows 7 (64bit)
Visual Studio 2012 Premium
What I have tried to fix the issue:
Rebuild solution
Clean solution
wipe outputpath data
reboot computer
bite in the desktop
Nothing helped :/
Anyone can help please to spot the error? Thanks!
xcopy is usually located in C:\Windows\system32 so in order for VS to see xcopy this path should be in your PATH environment variable. You can check this by running:
echo %path%
in command line and you should see path to xcopy alongside other folders...
I just added C:\Windows\System32\ in front of the xcopy command and it solved things. In mean time also check that you didn't at some additional line breaks on accident. But if you like, you can also add the system directory back to your windows path. You can find this at computer - properties - advanced system settings - environment variables - system variables - path.
So for example:
C:\Windows\System32\xcopy /s /y "$(ProjectDir)bin\ken.MojoPortal.HtmlTools.Web.dll" "$(SolutionDir)Web\bin\"
P.S Originally posted here : https://ict.ken.be/xcopy-exit-with-code-9009-in-visual-studio-post-build

Resources