Sign in to follow this  
Followers 0
chiners_68

Cant get a hang of the quotes etc.. help please..

11 posts in this topic

#1 ·  Posted (edited)

the following line works in a batch file. changing permissions on C:\Program Files\activePDF for local users to modify rights.

"\\Server\Software\OS\Windows XP\CALCS\cacls.exe" "C:\Program Files\activePDF" /t /e /g "users":c

how do i quote this to work as a runwait.?

this is what ive got so far but it dosent work.

runwait('\\Server\Software\OS\Windows XP\CALCS\cacls.exe ' & 'C:\Program Files\activePDF /t /e /g users :c ')
Edited by chiners_68

Share this post


Link to post
Share on other sites



the following line works in a batch file. changing permissions on C:\Program Files\activePDF for local users to modify rights.

"\\Server\Software\OS\Windows XP\CALCS\cacls.exe" "C:\Program Files\activePDF" /t /e /g "users":c

how do i quote this to work as a runwait.?

this is what ive got so far but it dosent work.

runwait('Server\Software\OS\Windows XP\CALCS\cacls.exe ' & 'C:\Program Files\activePDF /t /e /g users :c ')
First of all take a look at your runwait line. Notice anyting missing?

RunWait('\\Server\


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

that was just a typo on my post not the actual script. i will amend.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

that was just a typo on my post not the actual script. i will amend.

The Quotes are also wrong in "C:\Program Files\activePDF" /t /e /g "users":c

Yoy can not have double quotes inide of double quotes

You could try

$App = FileGetShortName("\\Server\Software\OS\Windows XP\CALCS\cacls.exe") & Chr(32)

RunWait ($App & 'C:\Program Files\activePDF /t /e /g "users":c')

If users does not need to be quoted then remove the quotes around that as well so they are not sent as part of the string.

Edit:

Here is the rule about Quotes, If a string contains single quotes then surrount it with double quotes. If it contains double quotes then surround it with single quotes. If it contains both then break the string

Example: $A = "This part needs 'double' quotes" & ' This part needs "single" quotes'

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

GEOSoft,

Cant get this to work.

$App = FileGetShortName("\\SERVER\Software\OS\Windows XP\CALCS\cacls.exe") & Chr(32)

RunWait($App & 'C:\Program Files\activePDF /t /e /g "users" :c')

what does this bit do..? Chr(32)

Edited by chiners_68

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

GEOSoft,

hi thanks for your coments.

i dont see the point in putting $App = FileGetShortName("\\Server\Software\OS\Windows XP\CALCS\cacls.exe") & Chr(32) as it takes more to write than just by adding \\Server\Software\OS\Windows XP\CALCS\cacls.exe to the runwait line.

ill give you one a try.

You're right You have to type an extra 6 characters but you can probably do that in less than 2 hours.

The reason is that on occasion commands don't like a space as in Windows XP.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Like this

Runwait('"\\Server\Software\OS\Windows XP\CALCS\cacls.exe" "C:\Program Files\activePDF" /t /e /g users :c ')

:whistle:

Share this post


Link to post
Share on other sites

Like this

Runwait('"\\Server\Software\OS\Windows XP\CALCS\cacls.exe" "C:\Program Files\activePDF" /t /e /g users :c ')

:whistle:

Looking at his batch file code I'm not so sure that he needs any of the inner quotes.

Runwait("\\Server\Software\OS\Windows XP\CALCS\cacls.exe C:\Program Files\activePDF /t /e /g users :c ") might even do it.

No matter, I gave him the rule and the documentation about quotes in the help file is quite clear.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

me, who always tries to find other ways am saying, use setacl instead of cacls. I have had problems with cacls regarding the order in which it sets the rights.


> there are 10 types of people in the world, those who understand binary and those who don't.

Share this post


Link to post
Share on other sites

MhZ, gEOSoft,

they didnt work. any other ideas..?

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Hi Guys,

with some playing around i got it working. thanks all for your help.

this is what I did.

Runwait('"\\Server\Software\OS\Windows XP\CALCS\cacls.exe" "C:\Program Files\activePDF" /t /e /g "users":c ')
Edited by chiners_68

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0