Sign in to follow this  
Followers 0
marshallprank

Problem with _RunDos

12 posts in this topic

Hi,

i have the command:

$rc = _RunDos("start " & @ScriptDir & '"\Template\abc2.gts"')

Itis not working because my ScriptDir is C:\New folder --> the name contains space. How can i solve it?

Regards

Share this post


Link to post
Share on other sites



Hi,

i have the command:

$rc = _RunDos("start " & @ScriptDir & '"\Template\abc2.gts"')

Itis not working because my ScriptDir is C:\New folder --> the name contains space. How can i solve it?

Regards

Take a look at the problem outside of AutoIt context. How would you solve to run:

start C:\New Folder\Template\abc2.gts

Yes, you would enclose it in quotes:

start "C:\New Folder\Template\abc2.gts"

Then you can use the solution in AutoIt:

$rc = _RunDos("start """ & @ScriptDir & "\Template\abc2.gts""")

Share this post


Link to post
Share on other sites

Hi marshallprank,

why not use ShellExecute() instead?

:)


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

hi

@Manadar: it is not working :-(. when i give this Code, i get the DOS-Windows.

@Hannes123: With Shellexecute you can not use this extension .gts :-)

Share this post


Link to post
Share on other sites

@Hannes123: With Shellexecute you can not use this extension .gts :-)

You can most definitely call an extension .gts

ShellExecute uses the Program Associations in windows, i would recommend setting it up with that, then use shellexecute to just run the file, Windows should handle it from there. Out of curiosity, what is the .gts file for?

Share this post


Link to post
Share on other sites

marshallprank,

I thought you had solved this yesterday? :)


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Hi all

no i still have the problem.

.gts is an extension for a private tool.

Share this post


Link to post
Share on other sites

Hi all

no i still have the problem.

.gts is an extension for a private tool.

Well probably if you can start it via DOS start command you should be able to start it via ShellExecute(). What happens if you double-click the file?

:)


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

the problem is the blanck in the directoryName @Script.

Share this post


Link to post
Share on other sites

Make sure you surround your paths with double quotes.

Check Help File -> Using AutoIt -> Language Reference -> Variables, where you'll find

how to include them in your strings:

Strings are enclosed in double-quotes like "this". If you want a string to actually contain a double-quote use it twice like:

"here is a ""double-quote"" - ok?"

You can also use single-quotes like 'this' and 'here is a ' 'single-quote' ' - ok?'

You can mix quote types to make for easier working and to avoid having to double-up your quotes to get what you want. For example if you want to use a lot of double-quotes in your strings then you should use single-quotes for declaring them:

'This "sentence" contains "lots" of "double-quotes" does it not?'

is much simpler than:

"This ""sentence"" contains ""lots"" of ""double-quotes"" does it not?"

When evaluated, strings can have Env variables or Var variables substitution according to Opt() function definition.

Share this post


Link to post
Share on other sites

ok thanks

Share this post


Link to post
Share on other sites

Make sure you surround your paths with double quotes.

Check Help File -> Using AutoIt -> Language Reference -> Variables, where you'll find

how to include them in your strings:

Then you can use the solution in AutoIt:

$rc = _RunDos("start """ & @ScriptDir & "\Template\abc2.gts""")

Well, Manadar happened to mention this earlier, right? :)

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

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