Jump to content

Problem Executing commandline


Recommended Posts

I'm playing a bit with autoit. and I'm trying to mount an image in daemon tools using the command line.

Daemon tools help file:

-unmount
allows unmounting images from command line.
Syntax is: -unmount <n>
where 'n' means DVD-ROM device number ('0' - '3' allowed)

When i try to run the line shown below i get the following error returned

Het systeem kan het opgegeven pad niet vinden. >> simple translated by me>>

System cannot find given path

RunWait(@comspec & '/k c:\Program Files\D-Tools\daemon.exe -demount 1')

I guess that the "/k" that i'm using is wrong. I without it an cmd-window is opened and nothing else happens. I hope somebody can tell me what I'm doing wrong and where the /k stands for (perhaps a link with info)

tnxz

Link to comment
Share on other sites

Found the problem.

Solved it using the following code that i found on this forum:

$pathToDaemonTools   = "c:\Program Files\D-Tools\daemon.exe"
$pathToIso           = $aImLijst[1]

RunWait ( $pathToDaemonTools & ' -unmount 1' )
RunWait ( $pathToDaemonTools & ' -mount 1, "' & $pathToIso & '"' )
Edited by Muzzikap
Link to comment
Share on other sites

Found the problem.

Solved it using the following code that i found on this forum:

$pathToDaemonTools     = "c:\Program Files\D-Tools\daemon.exe"
$pathToIso             = $aImLijst[1]

RunWait ( $pathToDaemonTools & ' -unmount 1' )
RunWait ( $pathToDaemonTools & ' -mount 1, "' & $pathToIso & '"' )

<{POST_SNAPBACK}>

cool, thanks for posting the solution, it bugs me when people post a prob then fall off the planet because they resolved it, and others waste time trying to help
Link to comment
Share on other sites

It probably doesn't matter anymore now but I believe that the problem with this code:

RunWait(@comspec & '/k c:\Program Files\D-Tools\daemon.exe -demount 1')

is that you were not surrounding the path to the .EXE in double quotes. This would probably work for you:

RunWait(@comspec & '/k "c:\Program Files\D-Tools\daemon.exe" -demount 1')
Link to comment
Share on other sites

It probably doesn't matter anymore now but I believe that the problem with this code:

RunWait(@comspec & '/k c:\Program Files\D-Tools\daemon.exe -demount 1')

is that you were not surrounding the path to the .EXE in double quotes. This would probably work for you:

RunWait(@comspec & '/k "c:\Program Files\D-Tools\daemon.exe" -demount 1')

<{POST_SNAPBACK}>

tnxz for your reply.

Perhaps you or somebody else can tell me what the /k does. I don't get that part of the code.

Link to comment
Share on other sites

That's a command line switch for cmd.exe or command.com.

/C      Carries out the command specified by string and then terminates

/K      Carries out the command specified by string but remains

Just give this a try:

Start > Run > "cmd /k echo Hello World" (without quotes)

/c does the same thing, but closes cmd.exe right away, so it's useless for displaying things, but handy for doing something like

"cmd /c del C:\temp\*.tmp"

*Edit: Just so you know, @COMSPEC evaluates to whatever the command line utility is for your system (in my case "C:\WINDOWS\system32\cmd.exe" on my old Win98 system it would have been "C:\Windows\Command.com")

*Edit2: Wow, 2 more replies while I typed mine.. I took too long I think..

Edited by Saunders
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...