Jump to content

Need Help :)


hepo
 Share

Recommended Posts

Hello,

I' am trying to run dos commands and have problem with puting " in paths.

I' am doing something like this:

Run("cmd.exe" & " /k" & ""D:\Program Files\7-Zip\7z.exe"" & "a" & "-tgzip" ""\\server\arhive.zip"" & ""\\server\folder\*"")

I' am getting this

'D:\Program' is not recognized as an internal or external command,

operable program or batch file.

When I run only this

Run("cmd.exe" & " /k" & ""D:\Program Files\7-Zip\7z.exe"")

It's all good.

Help please

Link to comment
Share on other sites

Why are you cutting this all up in to pieces if you're not using a variable?

""D:\Program Files\7-Zip\7z.exe"" & "a" & "-tgzip" ""\\server\arhive.zip"" & ""\\server\folder\*""

Anyway, I think you're supposed to be using @comspec for this sort of stuff.

edit -

Maybe something like...

Run(@ComSpec & ' /k D:\Program Files\7-Zip\7z.exe a -tgzip "\\server\arhive.zip" "\\server\folder\*"')

Edited by xcal
Link to comment
Share on other sites

Run(@ComSpec & ' /k "D:\Program Files\7-Zip\7z.exe" a -tgzip "\\server\arhive.zip" "\\server\folder\*"')

No?

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

Check thi out

When I run this:

$soft='"D:\Program Files\7-Zip\7z.exe"'
$path1=' \\ro\Storage\tmp\aaaa.zip'
$path2=' \\ro\Storage\tmp\bg\'
Run(@ComSpec & ' /k' & $soft & ' a' & ' -tzip' & $path1 & $path2)oÝ÷ ØâºÜ»§¶¬jëh×6$soft='""D:\Program Files\7-Zip\7z.exe"'
$path1=' ""\\ro\Storage\tmp\Roger Sanchez\aaaa.zip"'
$path2=' \\ro\Storage\tmp\bg\'
Run(@ComSpec & ' /k' & $soft & ' a' & ' -tzip' & $path1 & $path2)oÝ÷ Ù8^¢ên¶+¡×jw!{>|XM ѹñ8^³+-zgz-~)ݶW¬¥ç"~'RZ¶)àj·!÷´÷m=Úº4÷d­¢¶ {Ov¶jt÷dhêó¨Þ²È§¸¢jkzË"àÓÝH#xãmc¦¨Þ²È§¸4÷`ÒÞ8Ûhé*&¦·¬²)àn
=Ø476Þ:`I©Üìùñ8^³+-zgz-~)ݶW¬¥ç"~'ß}÷ß}÷ß}÷ß}÷ß}÷ýÊx¯z{kÊØb±«­¢+ØÀÌØíͽÐÅ|ÄôÌäìÅÕ½ÐíèÀäÈíAɽɴÌäì(ÀÌØíͽÐÅ|ÈôÌä쥱ÌÀäÈìܵi¥ÀÀäÈìÝè¹áÅÕ½ÐìÌäì(ÀÌØíÁÑ Å|ÄôÌäìÅÕ½ÐìÀäÈìÀäÈíɼÀäÈíMѽÉÀäÈíѵÀÀäÈíI½ÈÌäì(ÀÌØíÁÑ Å|ÈôÌäìM¹¡èÀäÈí¹é¥ÀÅÕ½ÐìÌäì(ÀÌØíÁÑ ÈôÌäìÀäÈìÀäÈíɼÀäÈíMѽÉÀäÈíѵÀÀäÈíÀäÈìÌäì)IÕ¸¡
½µMÁµÀìÌä콬ÌäìµÀìÀÌØíͽÐÅ|ĵÀìÀÌØíͽÐÅ|ȵÀìÌäìÌäìµÀìÌäìµÑé¥ÀÌäìµÀìÀÌØíÁÑ Å|ĵÀìÀÌØíÁÑ Å|ȵÀìÀÌØíÁÑ È

Did not help.

I need some one to explain me how this "" works cause I dont unerstand a thing

Thanks

Edited by hepo
Link to comment
Share on other sites

Sometimes i have problems like this as well. Try writing the command line to a bat file via FileWriteLine(). Once you do that, have autoit run the bat file and then the bat file will run the program that you want to run.

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...