Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > The IT Pro > Programming
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Programming A discussion forum for programs and programming used in tech-related businesses.

Reply
 
LinkBack Thread Tools
Old 05-19-2009, 05:53 AM   #1 (permalink)
Registered User
 
Join Date: May 2009
Posts: 18
OS: Windows 2005


Pencil Help in batch script -chmod 777 command

Hi all,
I am using the following code to FTP the xml files to the UNIX folder


@echo off
SetLocal
:: Set local folder you want to upload here.
Set _lcd=C:\Folder to upload
:: Will use current folder as a Temp folder for the FTP Script
Set _tmpfld=%~dp0
Set _tmpfld=%_tmpfld:~0,-1%
:: Set the Folder on the FTP server that you want to upload to
Set _FTPRoot=/bcmf/intin/
>"%_tmpfld%\ftpcmds.}t{" Echo open ftp.server.com
>>"%_tmpfld%\ftpcmds.}t{" Echo Username
>>"%_tmpfld%\ftpcmds.}t{" Echo password
>>"%_tmpfld%\ftpcmds.}t{" Echo cd "%_FTPRoot%"
>>"%_tmpfld%\ftpcmds.}t{" Echo lcd "%_lcd%"
>>"%_tmpfld%\ftpcmds.}t{" Echo binary
>>"%_tmpfld%\ftpcmds.}t{" Echo mput *.*
>>"%_tmpfld%\ftpcmds.}t{" Echo chmod 777 *.xml
>>"%_tmpfld%\ftpcmds.}t{" Echo quit
ftp -v -i -s:"%_tmpfld%\ftpcmds.}t{"
:: Delete the script
Del "%_tmpfld%\ftpcmds.}t{"
EndLocal

In the highlighted line i actually need to give 777 permission for all the files in the UNIX box once it is transferred.
But i get an error in this line which states "INVALID COMMAND"
I also tried with find "." -exec chmod 777 but its throwing out the same error.

Kindly help me to set the permissions.

regards,
coddy.
Codesearcher is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 05-20-2009, 02:50 AM   #2 (permalink)
TSF Enthusiast
 
TheOutcaste's Avatar
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 756
OS: MS-Dos 6.22 - Win7


Re: Help in batch script -chmod 777 command

Don't know a lot about the FTP Server side of things, but did some googling and got some ideas.

You could try SITE CHMOD 777 filename.xml
Might have to use lowercase: site chmod

Are you sure it's a Unix system you are uploading to? Does SYST Return as Unix, or also give invalid command?

Could be the CHMOD command has been disabled for some reason. You'd have to contact the FTP site Admin and make sure they support using CHMOD.

Jerry
__________________
Microsoft MVP - Windows Desktop Experience
Of course I know all the answers; I just don't always match the answers to the right questions.
Rated R for Violence -- When your PC flies through a window, that's violent, right?
TheOutcaste is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 05-20-2009, 05:13 AM   #3 (permalink)
Registered User
 
Join Date: May 2009
Posts: 18
OS: Windows 2005


Re: Help in batch script -chmod 777 command

yes you are right... Its surely a UNIX system i am uploading to and i get an error as invalid command :(

But the chmod is working fine when i try try running the script thru Telnet.. so we cud confirm that CHMOD is not been disabled.
Codesearcher is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

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 Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 06:03 AM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85