»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 07-03-2003, 10:42 PM   #1 (permalink)
Banned
 
Siliconjunkie's Avatar
 
Join Date: Feb 2003
Location: Houston, TX
Posts: 1,595
Siliconjunkie is on a distinguished road
Send a message via AIM to Siliconjunkie
Why wont this command run in a batch file?

Ok, I am trying to write a batch file to set file permissions on all computers on the network. It will be run as an AT job so it needs to be completely automated. I have a command that works from a command prompt, but always dies when I try to run in as part of a batch file.

Here is the command:
Quote:
FOR /F " tokens=1 " %i in ('"net view|grep \\') do echo y|cacls $i\c$\* /T /C /G system:F administrators:F "mydomain\domain users":F
As I said, from a command prompt this works fine, it will go to all the machines that show up in a net view and set the permissions as I want.

When I put it in a batch or cmd file here is what I get:
Quote:
F was unexpected at this time.
C:\>FOR /F " tokens=1 " F administrators:F "mydomain\domain users":F
I know the permssions are far from perfect but I need to get this working before I can set any others.
Any ideas or suggestions?

Siliconjunkie is offline   Reply With Quote
Old 07-04-2003, 07:20 AM   #2 (permalink)
Registered User
 
meese's Avatar
 
Join Date: Jun 2003
Location: NJ
Posts: 1,096
meese is on a distinguished road
I'm not familiar with that particular script but do you need a double quote and a single quote before

net view | grep
meese is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 04:12 AM.