Jump to content

Run command not expanding vars?


Recommended Posts

You know, its not rocket science but it still doesnt work as you expect.

This is driving me nuts.

First problem when I run this code Msgbox complains $filename is not an array??

Second problem is even when I just write the string directly into a variable,

(what the lnk points to) the run command will not work when I specify that variable.

Dim $filename[6]
$filename = FileGetShortcut ("@UserProfileDir\Start Menu\Programs\WinRAR\WinRAR.lnk")
MsgBox(0,' ', $filename[0] )
Run( $filename[0] )

Please, any assistance appreciated.

Jarvil

Edited by jarvil
Link to comment
Share on other sites

  • Moderators

@UserProfileDir & "\Start Menu\Programs\WinRAR\WinRAR.lnk"oÝ÷ ØÚ-jëh×6"@UserProfileDir\Start Menu\Programs\WinRAR\WinRAR.lnk"oÝ÷ ÚÈhºW_¨º³,1Ë.xGb´Z+¶«ºx¬²ç­¯+aÆ®¶­se'Vâ6öÕ7V2fײb33²ö27F'Bb33²fײfÆTvWE6÷'DæÖRb33c¶fÆVæÖU³ÒÂb33²b33²Â5uôDR

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Some issues with the solution. I tried my test with ExpandEnvVars On and it made no difference. Accoring to the manual this should work with Expand Environment Variables switched on. Why doesnt this string work as expected?

"@UserProfileDir\Start Menu\Programs\WinRAR\WinRAR.lnk"
Edited by jarvil
Link to comment
Share on other sites

  • Moderators

Some issues with the solution. I tried my test with ExpandEnvVars On and it made no difference. Accoring to the manual this should work with Expand Environment Variables switched on. Why doesnt this string work as expected?

"@UserProfileDir\Start Menu\Programs\WinRAR\WinRAR.lnk"oÝ÷ Ûú®¢×ƧtIïUªìÉbå,z³ë¡ø¥x8«T±êÏ®âà⬬¶ëÖ¬#oz"×¢ëZØ­Â)eÂäûajج«zØ^~)^iËnjYrë究¼¢h¦º/yªh{ZÖÚ¶Ù^Â+aÙh«N¬yªÞ1§+¢ÌºÇ­ìjyèµ·¬ººèºw^u¼ªº^°Gb´²æ˲¢ëpéȶ.Hë-Á©íÊ­¢»§¶¬{¦¦WÊ+lzWÚºÚ"µÍÌÍÙ[[[YHH[]ÚÜÝ]
ÙÙ[[È ][ÝÉÌLÔÝY[IÌLÔÙÜ[ÉÌLÕÚ[TÌLÕÚ[][ÝÊBÙÐÞ
    ÌÎNÈ ÌÎNË ÌÍÙ[[[YVÌJB[ÛÛTÜXÈ  [È ÌÎNÈØÈÝ   ÌÎNÈ [È[]ÚÜ[YJ ÌÍÙ[[[YVÌJH ÌÎNÉÌÎNËÕ×ÒQJ
GL
Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Some issues with the solution. I tried my test with ExpandEnvVars On and it made no difference. Accoring to the manual this should work with Expand Environment Variables switched on. Why doesnt this string work as expected?

"@UserProfileDir\Start Menu\Programs\WinRAR\WinRAR.lnk"oÝ÷ Ûú®¢×ØDƧuV«JÚâ-ë-®)àRÇ«>ºW¸¬{"Ü"Z)z¶­zØ^±©jȺȧØ^§+¡K¬úè~)^*èºÛ"uêjËkxºÚ"µÍÜ
    ÌÎNÑ^[Ý[ÜÉÌÎNËJBÙÐÞ
    ÌÎNÉÌÎNË  ÌÎNÐÙÙ[Q   ÌLÔÝY[IÌLÔÙÜ[ÉÌLÕÚ[TÌLÕÚ[TÉÌÎNÊB

Look closer at the manual. An example it gives

:whistle:

Link to comment
Share on other sites

Look closer at the manual. An example it gives

:whistle:

Thanks Mhz,

Damn, I missed that last bit.

SmOke_N,

Sorry but I am not trying to prove a point. I am just trying to use the software. The definition of ExpandEnvVars is to enable us to use vars inside strings. I was simply doing it wrong.

Regards

Jarvil

Edited by jarvil
Link to comment
Share on other sites

  • Moderators

Thanks Mhz,

Damn, I missed that last bit.

SmOke_N,

Sorry but I am not trying to prove a point. I am just trying to use the software. The definition of ExpandEnvVars is to enable us to use vars inside strings. I was simply doing it wrong.

Regards

Jarvil

No worries, I learned something myself with MHz's post.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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...