Skizz Posted November 29, 2006 Posted November 29, 2006 Aight, quick question, I am creating an exe which contains a password to execute a program for users that do not have admin rights. The password contains an ' which is giving me issues in my script. any ideas? the code is pretty simple: RUN(@ComSpec & 'runas /user:username password' & "'" & ' program') Thanks!
BigDod Posted November 29, 2006 Posted November 29, 2006 Try RUN(@ComSpec & 'runas /user:username password' & "''" & ' program') Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
Skizz Posted November 29, 2006 Author Posted November 29, 2006 Try RUN(@ComSpec & 'runas /user:username password' & "''" & ' program') It still doesnt like it.
lcgreenwald Posted November 29, 2006 Posted November 29, 2006 How about RUN(@ComSpec & "runas /user:username password" & "'" & " program")
MHz Posted November 29, 2006 Posted November 29, 2006 (edited) Run(@ComSpec & ' /c runas /user:username password "program"') Edit: typos fixed use /c for line command mode Edited November 29, 2006 by MHz
dabus Posted November 29, 2006 Posted November 29, 2006 What do you want to do will not work until you a) use proper cmd-syntax ; close cmd after exec RUN(@ComSpec & ' /k XXX') ; leave it open RUN(@ComSpec & ' /c XXX') oÝ÷ ØÞ¸z»§jÆ欴z-±ç*Z²Ì(ا¶¬Ê{ZÅˬzØb±«¢+Ø)Õѽ%ÑMÑ=ÁÑ¥½¸ ÌäíQÉå%½¹ÕÌäì°Ä¤(()%UÍÉ9µ±ÐìÐìÌäíµ¥¹¥ÍÑÉѽÈÌäìQ¡¸í ¡¬½ÈÁ½ÝÈ($I¥½¸´´´ ½]¥éɹÉѽMÑÉд´´($í%¹ÁÕÑ ½àÑÕÉÌèQ¥Ñ±õeÌ°AɽµÁÐõeÌ°Õ±ÐQáÐõ9¼($ÀÌØíµ¥¹AÍÌô%¹ÁÕÑ ½à Ìäí%¹ÁÕÐÌäì°Ìäí¥µµÑ¡ÁÍ̸Ìäì°ÌäìÌäì°Ìäì¨Ìäì°Ìäì´ÄÌäì°Ìäì´ÄÌäì°Ìäì´ÄÌäì°Ìäì´ÄÌäì¤(%M±Ð($% ÍÉɽÈôÀí=,´Q¡ÍÑÉ¥¹ÉÑÕɹ¥ÌÙ±¥($$%IÕ¹ÍMÐ Ìäíµ¥¹¥ÍÑÉѽÈÌäì° ½µÁÕÑÉ9µ°ÀÌØíµ¥¹AÍ̤($$%% ½µÁ¥±Q¡¸($$$%IÕ¸ ÌäìÅÕ½ÐìÌäìµÀìMÉ¥ÁÑÕ±±AÑ µÀìÌäìÅÕ½ÐìÌäìµÀìÀÌØíµ¥¹AÍ̤($$%±Í($$$%IÕ¸ ÌäìÅÕ½ÐìÌäìµÀìÕѽ%ÑáµÀìÌäìÅÕ½ÐìÅÕ½ÐìÌäìµÀìMÉ¥ÁÑÕ±±AÑ µÀìÌäìÅÕ½ÐìÌäìµÀìÀÌØíµ¥¹AÍ̤($$%¹%($$%%ÉɽÈQ¡¸5Í ½à ÐÀäجÌÈ°ÌäíÉɽÈÌäì°ÌäíÉɽÈÍÑÉÑ¥¹Õ¹Èµ¥¸µ½Ìäì¤($$%á¥Ð($% ÍÉɽÈôÄíQ¡ ¹°ÕÑѽ¸ÝÌÁÕÍ¡($$%á¥Ð($% ÍÉɽÈôÌíQ¡%¹ÁÕÑ ½à¥±Ñ¼½Á¸($$%á¥Ð(%¹M±Ð($¹I¥½¸´´´ ½]¥éɹÉѽ¹´´´)±Í(ìAÕÐå½Õȵ¥¸µ½¡ÉÌÌìÌÌìÌÌì(%5Í ½à À°Ìäí$´Ìäì°UÍÉ9µ¤)¹%$
someone Posted November 29, 2006 Posted November 29, 2006 someone correct me if I'm wrong but I didn't think runas.exe alllowed you to store the password? ie you had to type it in everytime? While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd
Skizz Posted November 29, 2006 Author Posted November 29, 2006 (edited) someone correct me if I'm wrong but I didn't think runas.exe alllowed you to store the password? ie you had to type it in everytime?Okay, getting pretty close by assigning variables, but now it just gives me the runas functions?!? $user = "test" $password = "Password's" RUN(@ComSpec & ' /k runas' & ' /user:' & $user & ' ' & $password & ' C:\Temp\CAPTURE.EXE') Edited November 29, 2006 by Skizz
someone Posted November 29, 2006 Posted November 29, 2006 (edited) The more I think about it the more I'm very sure you can't enter a password into runas.exe.... Which means the best way I can think of to do it would be; $user = "user" $password = "password" Run(@COMSPEC & ' /c runas /user:'&$user&' notepad') And then have autoit send the $password var to the dos window. I tried to send keystrokes to the window but it didn't work although I know I've seen people do that so I would suggest in lack of a better option to try doing it this way EDIT- I apologize I assumed that since skizz posted again that something still wasn't working, but dabus' code looks like it should work... didn't mean to step on your toes Edited November 29, 2006 by someone While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now