Jump to content

Error with _RunDOS


Recommended Posts

Greetings!

I am re-releasing my file handler in AutoIt instead of its current Batch platform due to the user-friendly GUI.

I have run into an error when attempting to process files I need. I have 3 input boxes (Source Image, Source Archive, Output) and 3 variables respectively derived from FileOpenDialog, FileOpenDialog, FileSaveDialog. When you hit the fourth button it should execute a DOS command to copy the two input files into the output and delete the source depending on whether or not a Checkbox is ticked.

My code snippet:

Case $Button4
    _RunDOS(copy /b $inputi + $inputa $inputo)
    If GUICtrlRead($Checkbox1) == 1 Then
    _RunDOS(del $inputi)
    _RunDOS(del $inputa)
EndIf

My error:

Line 66 (File "D:\Documents and Settings\Administrator\Desktop\test.au3

_RunDOS(copy /b $inputi + $inputa $inputo

_RunDOS(^ERROR

Error:Error parsing function call.

Link to comment
Share on other sites

My error:

Do you read help-file before using this function? And also read about strings, datatypes, and operators (under «Language Reference» in the help file).

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Something's Missing! :D

"" + &

Ok I've placed the quotes

Case $Button4
    _RunDOS("copy /b $inputi + $inputa $inputo")
    If GUICtrlRead($Checkbox1) == 1 Then
        _RunDOS("del $inputi")
        _RunDOS("del $inputa")
    EndIf

I'm clueless where to place the other symbols...

Sorry I'm a bit of a AutoIt noobie :\

Link to comment
Share on other sites

I'm a bit of a AutoIt noobie

This reason is not good enough to ignore and not read the help-file...

Case $Button4
    _RunDOS("copy /b " & $inputi & $inputa & $inputo)
    If GUICtrlRead($Checkbox1) == 1 Then
        _RunDOS("del " & $inputi)
        _RunDOS("del " & $inputa)
    EndIf

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

This reason is not good enough to ignore and not read the help-file...

Case $Button4
    _RunDOS("copy /b " & $inputi & $inputa & $inputo)
    If GUICtrlRead($Checkbox1) == 1 Then
        _RunDOS("del " & $inputi)
        _RunDOS("del " & $inputa)
    EndIf
Tried it before. Didn't work. Copy and pasted just to make sure and no error is thrown however, it does nothing.

This is the original command:

copy /b & %var1% + %var2% %var3%
del %var1%
del %var2%
Edited by thejay2012
Link to comment
Share on other sites

Tried it before. Didn't work. Copy and pasted just to make sure and no error is thrown however, it does nothing.

This is the original command:

copy /b & %var1% + %var2% %var3%
 del %var1%
 del %var2%
Instead of RunDOS in your code, use ConsoleWrite. Then you can see what the string actually looks like and I think you will quickly see what's wrong. When you get it as you want it then you can use the string construction in RunDOS.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I've decided to heck with the annoying batch commands.

Is there any identical AutoIt command to combine files.

I'll give an example:

The batch was the following->

copy example_image.jpg + example_archive.zip example_output_image.jpg

The example_output_image.jpg in this case appeared to be an image and opened like an image of example_image.jpg but when you renamed the extension from .jpg to .zip the example_archive.zip and all of its contents were uncorrupted (as was the image). That is my main workaround from batch that I need for this program. A name of a command would be most helpful here :D

Link to comment
Share on other sites

You have not tried to even read the help file.

I seriously doubt you have even tried Martin's suggestion.

Personally I think a batch file will be easier for you, because right now, you have no hope of even making it work, how do you expect to do something harder?

Link to comment
Share on other sites

he batch was the following->

_RunDOS("copy example_image.jpg + example_archive.zip example_output_image.jpg")

And for your first example:

Case $Button4
    _RunDOS("copy /b " & $inputi & " + " & $inputa & " " & $inputo)
    If GUICtrlRead($Checkbox1) == 1 Then
        ;_RunDOS("del " & $inputi)
        ;_RunDOS("del " & $inputa)
        FileDelete($inputi)
        FileDelete($inputa)
    EndIf

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

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