Sign in to follow this  
Followers 0
fox_91

command doesn't work for some reason... suggestion?

7 posts in this topic

I am trying to take one text file and append its contents to another file. i got it to work in DOS, and tried the _rundos command like this

_rundos("copy log.txt+spybotlog.txt c:\zlog.txt /y")

so it takes the 2 files and makes them one file then i use

_rundos("copy zlog.txt c:\log.txt /y")

so that puts them back in my org log file.

but for some reason those 2 commands do not work in my script.

does anyone have a idea why it doesn't run in the script but does in DOS fine? and is there a easy way to combine the 2 files together without long winded code?

thanks

Share this post


Link to post
Share on other sites



I am trying to take one text file and append its contents to another file. i got it to work in DOS, and tried the _rundos command like this

_rundos("copy log.txt+spybotlog.txt c:\zlog.txt /y")

so it takes the 2 files and makes them one file then i use

_rundos("copy zlog.txt c:\log.txt /y")

so that puts them back in my org log file.

but for some reason those 2 commands do not work in my script.

does anyone have a idea why it doesn't run in the script but does in DOS fine? and is there a easy way to combine the 2 files together without long winded code?

thanks

Try this:

RunWait(@ComSpec & " /c copy zlog.txt c:\log.txt /y")

and if you want the window to be hidden use this flag: @SW_HIDE


[quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD()

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

two things to consider:

have you used the #include for the _RunDos() UDF?

the copy command specifies that options come before arguments i.e.

copy a + b c /y is technically not correct, but should be:

copy /y a + b c
Edited by flyingboz

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

two things to consider:

have you used the #include for the _RunDos() UDF?

the copy command specifies that options come before arguments i.e.

copy a + b c /y is technically not correct, but should be:

copy /y a + b c

actually it does work that way also

RunWait(@ComSpec & " /c copy log.txt + spybotlog.txt c:\zlog.txt /y","",@SW_HIDE)
RunWait(@ComSpec & " /c copy c:\zlog.txt c:\log.txt /y","",@SW_HIDE)

XP Pro SP2

Copies one or more files to another location.

COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B]

[+ source [/A | /B] [+ ...]] [destination [/A | /B]]

source Specifies the file or files to be copied.

/A Indicates an ASCII text file.

/B Indicates a binary file.

/D Allow the destination file to be created decrypted

destination Specifies the directory and/or filename for the new file(s).

/V Verifies that new files are written correctly.

/N Uses short filename, if available, when copying a file with a

non-8dot3 name.

/Y Suppresses prompting to confirm you want to overwrite an

existing destination file.

/-Y Causes prompting to confirm you want to overwrite an

existing destination file.

/Z Copies networked files in restartable mode.

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

two things to consider:

have you used the #include for the _RunDos() UDF?

the copy command specifies that options come before arguments i.e.

copy a + b c /y is technically not correct, but should be:

copy /y a + b c

OK, three

how does the UDF handle user interaction ? (The /y switch according to the docs on my XP home wkstation states that this requires user confirmation for overwrites - not normally what

you're going for when trying to automate a process.

Nanner Nanner Nanner! :lmao: Just kidding...


[quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD()

Share this post


Link to post
Share on other sites

yep - nothing like misreading the docs :lmao:


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

Bah i can't get the quotes to work right lol.... anywaysi couldn't get those commands to run right... jsut sat there.... but it did spur my mind... which then i remembered i was using relative paths and not full path names, so it couldn't copy the files cuz they wern't there lol :">

anyways thanks for the fast replys

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