Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to lock a bat file on Windows XP machine

Status
Not open for further replies.

techwtr

MIS
Oct 13, 2003
62
0
0
US
I need to figure out a way to lock a bat file that I am using. There are a couple commands in bat file that we don't want people knowing, but are necessary for bat file to run. I have been searching the web and haven't found anything. The pc's I will be running bat file on are Windows XP. Any help will be appreciated.

 
What exactly do you want to happen, elaborate on lock?
What commands are in the file that are sensitive?

Matt J.

Please always take the time to backup any and all data before performing any actions suggested for ANY problem, regardless of how minor a change it might seem. Also test the backup to make sure it is intact.
 
I presume you want to stop anyone opening the file and reading it? If that is so, I don't know of any way to do this. Even enabling advanced security - you have to allow read for execute to work! I guess you could try making the users life harder by having a shortcut to run it and giving the file a strange extension that won't be easy to open? Unless someone knows better of course!
 
Get a batchfile compiler to turn the .bat into an .exe, or re-create the procedure with AutoItScript(.com)

HTH
TonHu
 
There were some commands to turn on and off a particular program that I was wanting to hide. The theory is the user community that we have isn't that smart to dig into looking at a bat file. What my thought was after doing this posting was to make the bat file hidden. That way if the user knew what it was they couldn't find it.

I will take the suggestions above under advisement.

Thanks
 
attrib +h (or right click on filename & select hide) can easly be discovered by the user & reversed (or simply show hidden files. Unfortunately in XP it doesn't seem possible to set an execute only flag. So TonHu's suggestion of compiling it seems to me the best answer.
 
And I can reverse compile your compiled bat file.
 
wantstolearncfm is right. But you don't need to make it a hidden folder on the server. You could simply assign the ReadShare permission and the Read and Execute NTFS permission. On the containing folder, do not allow the List Folder Contents permissions, so they won't be able to see the file. Also, do not allow the modify and change permissions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top