Jump to content

Problem with _RunDos


Recommended Posts

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""")
Link to comment
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?

Link to comment
Share on other sites

  • Moderators

marshallprank,

I thought you had solved this yesterday? :)

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
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]
Link to comment
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.

Link to comment
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]
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...