access denied in administration cmd

chirag2100chirag

New member
Dec 23, 2017
3
0
0
Visit site
hi,i am learning windows bash script like said in some tutorial books i tried to find a file using assoc | find
like assoc | find "string.bat" >C:\Users\chirag
but i got that access denied,but i am using local administrative account with full privilege of administrative and i am using administrative cmd instead of common cmd.please tell me whey i am getting access denied here is my code:
""" C:\>assoc | find "string.bat" > C:\Users\chirag
Access is denied.""""
 

TechFreak1

Moderator
May 15, 2013
4,626
19
38
Visit site
hi,i am learning windows bash script like said in some tutorial books i tried to find a file using assoc | find
like assoc | find "string.bat" >C:\Users\chirag
but i got that access denied,but i am using local administrative account with full privilege of administrative and i am using administrative cmd instead of common cmd.please tell me whey i am getting access denied here is my code:
""" C:\>assoc | find "string.bat" > C:\Users\chirag
Access is denied.""""

Even if you have full admin priveleges on your user, you still need to run CMD with elevated priveleges.

Hold shift + ctrl and then open CMD via left click, this will cause a user access control prompt to appear and on the user access control prompt left click "Yes".

As "C:\Users\chirag" indicates you are actually running CMD without admin rights.

"C:\WINDOWS\system32>" indicates you are running CMD with admin rights.
 

chirag2100chirag

New member
Dec 23, 2017
3
0
0
Visit site
first i will thank you,thank you for your support.
i did exactly what you said i opened cmd as administrator everything happened like you said like control prompt appeared and i hit yes then i tried my command but same thing happened.i tried powershell as administrator but in their same thing happened Screenshot (1).png
please help me.any help will be great full.i am new to programming as first i choose windows bash to learn.i think it will be good to know the environment one is using so i choose windows.
 

TechFreak1

Moderator
May 15, 2013
4,626
19
38
Visit site
first i will thank you,thank you for your support.
i did exactly what you said i opened cmd as administrator everything happened like you said like control prompt appeared and i hit yes then i tried my command but same thing happened.i tried powershell as administrator but in their same thing happenedView attachment 138439
please help me.any help will be great full.i am new to programming as first i choose windows bash to learn.i think it will be good to know the environment one is using so i choose windows.

For a valid list of CMD commands, type help in the command prompt.

Since you are new to programming I recommend you look at Bob Tabor's tutorials, the links are as follows and download visual studio express (now called visual studio community 2017):

www.visualstudio.com/vs/visual-studio-express/


channel9.msdn.com/Series/C-Sharp-Fundamentals-Development-for-Absolute-Beginners

channel9.msdn.com/Niners/Bob_Tabor


 

cheaorale

New member
Oct 15, 2019
3
0
0
Visit site

Ryujingt3

New member
Nov 13, 2013
3,310
1
0
Visit site
You still didn't answer him properly.
@TechFreak1 was right to point out the programming fundamentals. If @chirag2100chirag wants to learn programming then Bash script isn't how to start. Programming is like learning a language, do you remember how you learnt how to read, write and speak? By learning the basics first and programming is so vast that you need to understand the core concepts first and then once you have those you can branch out to other languages.

To answer the OP, or at least try, what happens if you run the Find command in a different location, e.g. use it to find a bat file in your Downloads folder and not Users. Please try that and also try learning more about the fundamentals of programming. It'll help you in the long term.
 
Last edited:

Members online

No members online now.

Forum statistics

Threads
326,613
Messages
2,248,635
Members
428,524
Latest member
Stepsjames