Jump to content
Sign in to follow this  
Ag3nt0rang3

@Comspec help

Recommended Posts

Ag3nt0rang3

I have a number of lines that i need to run in cmd but i have no idea how to use comspec, could someone conver these .bat codes to autoit ?

1.

cd /d "C:\Program Files (x86)\Silkroad\ScreenShot"

ren *.jpg *.bak

2.

@echo off

cd /d "%~dp0decode"

for %%f in ("C:\Program Files (x86)\Silkroad\ScreenShot\*.jpg") do java -cp decode.jar captcha.Main "%%~f" "%~dp0code.txt"

cd /d "%~dp0"

type code.txt

thanx in advance ^_^

Share this post


Link to post
Share on other sites
Jos

You can write this in native AutoIt3 syntax. just open the helpfile and look for the proper functions.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Ag3nt0rang3

No offence jos but that did not help at all. I NEED them to run at comspec level and have no idea how to use @COMSPEC.

Share this post


Link to post
Share on other sites
Jos

No offence jos but that did not help at all. I NEED them to run at comspec level and have no idea how to use @COMSPEC.

No offence back, but then just simply put it in a batch file and use Run() or ShellExecute() to run the batch file.

There are a zillion examples in these forums on how to run something with @comspec ^_^

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Ag3nt0rang3

Ok I did the first one - i feel kinda stupid now ...

FileMove($spath & "\*.jpg", $spath & "\*.bak")

But how the hell do i do the second one in autoit?

Edited by Ag3nt0rang3

Share this post


Link to post
Share on other sites
Jos

These should do it:

FileChangeDir()
FileFindFirstFile()
While 1
    FileFindNextFile()
    If @error then ExitLoop
    RunWait( java......)
Wend
FileChangeDir()
ShellExecute(logfile)

Jos ^_^

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Ag3nt0rang3

I dont actually understand what the second.bat file is doing. Could you possibly write it in autoit for me. sorry to be a pain and thnx for your help so far.

Share this post


Link to post
Share on other sites
Juvigy

You have the 2 bat files right?

Just do the following in autoit:

RunWait ( "C:\batfile1.bat")

RunWait ( "C:\batfile2.bat")

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.