> While this command works on win cmd prompt, it fails from a batch :
> 
> vim -c "source C:\Documents and Settings\user\Mes documents\util
> \myScript.vim" -c "argdo call TangoTemplateNb1()" -c "exec 'saveas ' .
> expand('%:p:h') . '\newFile.txt'" -c q exportSql.xml
> 
> "Documents and Settings\user\Mes documents\util\exportSql.xml" [unix]
> 112L, 7982C
> ":p:h\newFile.txt"
> Erreur détectée en traitant command line :
> ":p:h\newFile.txt" E212: Impossible d'ouvrir le fichier pour y écrire

This sounds like a classic case of variable mis-expansion.  DOS 
batch files use "%" for variable names, so if you put it in a 
.bat file, you need to use

   ...expand('%%:p:h')...

so that the shell passes a single "%" to Vim

-tim

[PS: laughing at how your internationalized Windows does change 
"Mes documents" but doesn't change "Documents and Settings"]





--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to