Showing results for 
Search instead for 
Do you mean 


Regular Advisor


I am runing HP-UX 11.11 and have mounted a windows directory from my unix box. How do i execute a .bat on the windows drive in which i am mounted on?
Honored Contributor

Re: Cifsclient


Note that on the hp-ux host you can only execute hp-ux related command - not windows-based commands.

Same for the windows host, you cannot run unix commands from there.

In case, your .bat file contains unix commands, you must change the attribute of the file using the following command before executing it:
chmod +x yourbatfile.bat

kind regards
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Trusted Contributor

Re: Cifsclient

Hello Jason and Yogeeraj,

This is Eric in the HP CIFS Client software lab. Yogeeraj gave an excellent answer, but I would correct the comment on use of chmod(1)--it cannot be used to change the 'x' bit unless the server is a Unix or Linux system using CIFS Unix Extensions.

It is true that the 'x' bit must be set on the remote file in order for the local HPUX system to execute the file. But, because Windows and Unix filesystems handle permissions in very different (and incompatable) ways, executing chmod against a mounted Windows filesystem does not work in any predictable or supported fashion (though you can have limited use of the 'w' bit).

So how can one set the 'x' bit for a file stored on Windows? Since there is no such concept as an 'x' bit in Windows, the CIFS Client uses this bit in a unique and flexible manner. The user can configure the CIFS Client to map the execute bit to any of the DOS attribute bits "system", "archive", or "hidden". For example, when you do 'ls -l', if the CIFS Client is configured for execMapping = "hidden"; and the hidden bit is set on the server, the CIFS Client causes the 'x' bit to appear to be set in the local listing.

execMapping can also be set to "on" or "off". When we first released this software we decided to make the default setting "on", meaning the 'x' bit will _always_ appear to be set for files on Windows servers. We did this precisely for this situation, that is, the ability to locally execute files stored on remote Windows servers.

Note also, as mentioned above, on servers that support CIFS Unix Extensions (Samba and its variants, including the HP CIFS Server), file permissions and chmod are fully implemented and usable in the standard fashion.

-Eric Raeburn
Trusted Contributor

Re: Cifsclient

A clarification on my previous post: The statement that chmod cannot be used to change the 'x' bit should have been qualified with "under the default execMapping setting of 'on'". In this case, chmod will not change the appearance of the 'x' bit--it always appears set. But if execMapping is configured as one of the DOS file attributes "hidden", "archive", or "system", then you indeed can manipulate that attribute on the remote server via chmod.

But, as stated previously, regardless of how this parameter is configured, the 'x' bit must appear to be set on the HPUX host in order for the file to be locally executed.