Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help for .batch files

 
pramod talekar
Ranch Hand
Posts: 328
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm going through batch files creation for understanding Ant.

I wrote the following code in Notepad and saved it correctly as Listofprograms.bat (Save as Type : All Files)

but I'm not able to save it under C drive as it says permission not granted, would you like to save it in other location ?

This despite, I'm being the only Admin and User of my machine (win 7 OS).
Also after saving in another location, if I run it in command prompt. it shows "Access is denied!".

Please advise.
 
Henry Wong
author
Marshal
Pie
Posts: 20881
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably don't have write permission for the top level directory. In fact, I believe by default, you shouldn't have such permission.

Try writing somewhere else instead. Since you are the admin, you can change the properties for the root directory, but it's probably not a good idea, as it was probably done to protect you from accidentally deleting the operating system.


Regardless, this is not Java related. Moving to the general computing forum.

Henry
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm being the only Admin and User of my machine (win 7 OS)

Even admin users on Win7 have restricted rights. You can try opening a Command Prompt with the "Run as Administrator" option (right-click on Command Prompt in the Start menu to see this option). But Henry's advice is still the best - create some subdirectory under the root directory and do all of your work there.
 
pramod talekar
Ranch Hand
Posts: 328
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peter and Henry,

I created a folder Testbatchfiles under the C drive and was able to save the batch file there.
But running the code still shows "Access is denied!".
 
pramod talekar
Ranch Hand
Posts: 328
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please ignore the previous message.
I'm able to run it after selecting Run as Administrator.

Thanks Peter and Henry.

cheers..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic