Sign in to follow this  
Followers 0
r2dak

how can i run this via auto it

8 posts in this topic

hi can you tell me how can i run cscript.exe with these arguments using a autoit script currently i'm using a batch file to run this

"C:\Windows\System32\cscript.exe" "C:\project\rohit.vbs" "C:\project\fileneame.exe"

[center][font=comic sans ms,cursive]PEACE & LOVE[/font][/center]

Share this post


Link to post
Share on other sites



Read the help for ShellExecute or Run

If you have problem, just say

1 person likes this

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

hi i tried RUN

FileInstall("rohit.vbs",@TempDir & "\rohit.vbs")
Run("C:\Windows\System32\cscript.exe" @TempDir & "\rohit.vbs" "C:\project\fileneame.exe")

and

Run("C:\Windows\System32\cscript.exe" & @TempDir & "\rohit.vbs" & "C:\project\fileneame.exe")

not working any ideas ???

now trying ShellExecute

Edited by r2dak

[center][font=comic sans ms,cursive]PEACE & LOVE[/font][/center]

Share this post


Link to post
Share on other sites

Run(@ComSpec & " /c " & "C:\Windows\System32\cscript.exe" & " " & "C:projectrohit.vbs" & " " & "C:projectfileneame.exe", "", @SW_HIDE)

You have forget the space

Share this post


Link to post
Share on other sites

Or convert the vbscript to autoit and save yourself the headache.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Run(@ComSpec & " /c " & "C:\Windows\System32\cscript.exe" & " " & "C:projectrohit.vbs" & " " & "C:projectfileneame.exe", "", @SW_HIDE)

You have forget the space

didnt work :(

Or convert the vbscript to autoit and save yourself the headache.

sorry but i'm just a beginner in autoit can you please tell me how can i do that or where i can learn that

Edited by r2dak

[center][font=comic sans ms,cursive]PEACE & LOVE[/font][/center]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Read the help for ShellExecute or Run

If you have problem, just say

:D got it working thank you

i did this

FileInstall("rohit.vbs",@TempDir & "\rohit.vbs")
ShellExecute(@TempDir & "\rohit.vbs","C:\project\fileneame.exe")
Edited by r2dak

[center][font=comic sans ms,cursive]PEACE & LOVE[/font][/center]

Share this post


Link to post
Share on other sites

Good for you ;)

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Similar Content

    • Eggsplorer
      By Eggsplorer
      Hi,
      Ich hab ein Script für Windows Updates, dass nach dem OOBE aufgerufen werden soll. Run/RunOnce ist daher nicht möglich.
      Stattdessen möchte ich das Script in den Autostart schreiben lasse. Wenn die OOBE beendet wird und der Administrator angemeldet wird, soll das Update-Script einmalig aufgerufen werden und sich anschl. selbst löschen.
      Lang rede, kurzer Sinn:
      Wie kann ich folgendes Script in den Autostart schreiben?
      RunWait(@ComSpec & " /c " & "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File C:\UA\Scripts\win-updates.ps1 -MaxUpdatesPerCycle 100 -RestartRequired 1", "") Ich würde ungern eine BAT oder EXE reinkopieren, da ich es unsauber finde. Die müsste ja auch zusätzlich irgendwo liegen.
      Danke
      Eggsplorer
    • BlazerV60
      By BlazerV60
      Hello all,
      I've written the code below which launches chrome in incognito mode and then proceeds to go to the autoit website.
      From my understanding, the Run() command is also supposed to output the PID number related to the application that got launched from the Run command.
      However when I run the below lines, it outputs a PID number that is different from the newly launched chrome browser's PID number, does anyone know why and possibly explain how I could retrieve the accurate PID number associated with the newly launched browser?
      Global $iPid = Run(@ComSpec & ' /c start chrome.exe https://www.autoitscript.com/forum/ -incognito' ,"", "") msgbox(0,"",$iPid) Thank you,
      Brian
    • rudi
      By rudi
      Hello.
      I'm too stupid to see my mistake:
      To investigate the internal "dictionary" of TIFF files I'd like to read in the files in binary mode and to check, if there are more than one pages "in" this TIFF.
      Notepad++, "View as Hex" is presenting the first bytes as "49 49 2a 20 08 20 20 20 12" for the TIF attached to this posting
      The "TIFF Header Format" is easy:
      Offset 00h, 2 Byte = Byte Order, "II"=intel, "MM"=motorola. (I = 0x49)
      --> II
      Offset 02h, 2 Byte = Version Nr.
      Offset 04h, 4 Byte = pointer to first IFD entry
      Description of TIFF header: https://www.awaresystems.be/imaging/tiff/faq.html#q3
       

      Howto read and analyse the binary content correctly? This is my messy, not operational code:
       
      $sampleTiff="H:\daten\tif\11\11\111111.TIF" $h=FileOpen($sampleTiff,16) $content=FileRead($h) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $content = ' & $content & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console FileClose($h) $type=VarGetType($content) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $type = ' & $type & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $ToString=BinaryToString($content) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $ToString = ' & $ToString & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console ConsoleWrite(@CRLF & @CRLF) $content=StringTrimLeft($content,2) ; cut off the leading "0x" ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $content = ' & $content & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console for $i = 1 to 8 step 8 $next=StringMid($content,$i,2) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $next = ' & $next & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $Chr=BinaryToString($next) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Chr = ' & $Chr & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console ConsoleWrite(@CRLF & "---" & @CRLF) Next Regards, Rudi.
      111111.TIF
    • rootx
      By rootx
      I need help to understand why the run function does not work, but if i use it directly inside cmd shell the command works. $where is the name of the jpg file
      ShellExecute(@ComSpec ," /k C:\Users\root\Desktop\test\exiftool.exe -p $FileName "&'"'&$where&'"'&" > "&'"'&@ScriptDir&"\out.txt"&'"',@ScriptDir);<----- work Run("C:\Users\root\Desktop\test\exiftool.exe -p $FileName "&$where&" > "&@ScriptDir&"\out.txt",@ScriptDir);<--- doesn't work I would use the run command!
      Thx
    • ur
      By ur
      I am running the tomcat batch file through autoit   and need to wait until the below line I get in console output.

      But when I am trying to read the console output using the ProcessEx UDF, I am getting only the partial output.
      So, can you please suggest how to handle this.