syntax problems multiple commands (command & command)

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Jun 6, 2011
7
0
#1
Hi there,

I am new to TCC and I especially focus on the "foldermonitor" function but having problem with the syntax when including multiple commands (only one command allowed with the function) with an "&" in the parentheses below:

foldermonitor /s "C:\Users\Gappe\Documents\My Dropbox\demo_local\inboxes" modified created 2 (set inbox_directory=%%_foldername & set inbox_file=%%_folderfile1)
echo %inbox_directory
echo %inbox_file

When executing the row and copying a file to the monitored folder I get the following error message:

[C:\Program Files\JPSoft\TCMD12]TCC: C:\Users\Gappe\Documents\TCC batfiles\Test foldermon
itor folderfile1 copy.bat [4] Unbalanced parentheses "(set inbox_directory=%_foldername
& echo %inbox_file "

I have not figured out how to solve this. Have tried many different alternatives (e.g. separate parentheses for both "set" commands etc) but it does not seem to solve the problem. Any suggestions? Help appreciated!

Furhtermore - where can I find a manual (not the help file)?

Best regards Jan
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,383
39
Albuquerque, NM
prospero.unm.edu
#3
re: syntax problems multiple commands (command & command)

I am new to TCC and I especially focus on the "foldermonitor" function but having problem with the syntax when including multiple commands (only one command allowed with the function) with an "&" in the parentheses below:

foldermonitor /s "C:\Users\Gappe\Documents\My Dropbox\demo_local\inboxes" modified created 2 (set inbox_directory=%%_foldername & set inbox_file=%%_folderfile1)
echo %inbox_directory
echo %inbox_file
I'm not familiar with FOLDERMONITOR myself and can't enlighten you about any quirks in its syntax, but I suspect that you may have better luck using strong quotes instead of the parentheses:

Code:
foldermonitor /s "C:\Users\Gappe\Documents\My Dropbox\demo_local\inboxes" modified created 2 `set inbox_directory=%_foldername & set inbox_file=%_folderfile1`
 
Jul 1, 2008
81
0
70
Montreal
#4
re: syntax problems multiple commands (command & command)

I get the following error message:

[C:\Program Files\JPSoft\TCMD12]Unbalanced parentheses "(set inbox_directory=%_foldername
& echo %inbox_file "
I just ran the foldermonitor command. The inbox_file variable it defined includes the parenthesis at the end of your command:
Code:
inbox_file=%_folderfile1)
Try putting a space between "%%folderfile1" and the parenthesis.
--
Peter
 
Jun 6, 2011
7
0
#5
re: syntax problems multiple commands (command & command)

Hi there,

Thanks for quick responses!
The "strong quote" solved it.
Thanks for link to manual.
Not been able so far to solve the problem with an additional space - but will keep it mind if similar problems should occur.