I need a Batch Script - Page 3 - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Software > Programming
Click Here to Login
Reply
 
Thread Tools Display Modes
 
Old 02-17-2014, 08:56 PM   #21 (permalink)
Private Joker
 
carnageX's Avatar
 
Join Date: Feb 2007
Location: South Dakota
Posts: 24,690
Default Re: I need a Batch Script

Quote:
Originally Posted by luke127 View Post
It's a pain because I have to learn all the new syntaxes including the $ and .\ etc. Which I really don't want to/need to do.
Welcome to programming. I've had to learn several languages' syntaxes before for little things.

Quote:
Basically the last missing piece of this script is:

Prompt user for drive letter
set output of prompt to variable "drive"
input variable drive to the script.

Sounds simple enough, but is not the simplest thing to do in batch coding. I have looked into wmic and will see if this will run on batch scripts executed on computers which I do not have administrative permissions on. This whole script is designed to be run on ANY computer regardless of permissions, so I need to make sure the whole thing is designed efficiently and that it works.
Did you try what I suggested at the end of my other post?

Quote:
The reason you were having the permissions error with the Recycle Bin folder is because it's trying to set permissions on EVERY folder inside the root of the drive, which includes System folders (such as the Recycle Bin folder that gets created on every storage drive by default).

Because of this line:
icacls %LOCKFOLDER%\* /deny Everyone:F

Get around this by just putting everything you want to lock inside of a subdirectory, and then run icacls on the subdirectory instead of the root of the drive.
__________________

__________________
Laptop: MSI GT70 2OC-059us | i7-4700MQ | 16GB | GTX 770m | 500GB SSD / 750GB HDD | 17.3" | Win10 Pro
Desktop: 4690k | 12GB g.Skill RipJaws | GTX 970 | 520hx | Z87X-UD4H | Corsair Vengeance C70 | Corsair H110 | Acer 25" | Acer 22" | Win10
Mobile: Google Pixel XL


If I help you, or you just like what I said, rep me by clicking the under my post
carnageX is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a password protected batch file with a batch file MattPwns Programming 2 07-03-2010 05:04 PM
Batch scripting: Startup applications and close batch file LincolnX Microsoft Windows and Software 7 01-17-2008 08:50 PM
Windows server 2003 user script/batch slayerduck Microsoft Windows and Software 2 06-03-2007 11:16 AM
script?/batch? IBMan Linux and Open Source 3 09-24-2006 08:46 PM
Batch Files (trying to get a simple FTP script to work) Vormund Microsoft Windows and Software 10 07-22-2005 10:47 PM



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 02:54 PM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2018, vBulletin Solutions, Inc.