Jump to content

simple dos command


Recommended Posts

Hi, Guys,

Too much for me , I'm afraid......

$rc = _RunDos("for /f %%s in ('dir /b *.dll') do regsvr32 /s %s")

$ErrorCode = RunWait( 'Psservice \\' & $line & ' stop "Windows Firewall/Internet Connection Sharing (ICS)"',"",@SW_HIDE)

Local $Cmd = StringFormat('%s /c "%s" /switch "%s" > "%s"', @ComSpec, $File1, $File2, $File3)

I know this DOS stuff comes narurally to some of you, but not to me!

What about if I only can read the helpfile in DOS? i have no idea how those lines work.

Can you translate it into workable UDFs that even I can use, with just simple func calls in autoIt language, so we don't need to know DOS commands, but still have the utility?

Best, Randall

[if you need examples, take the simple 'Directory" Command;; ]

1. SlimShady [look for his ......"MyUDFs.au3"]

_DIR($Folder, "/4/O-g/O-d/n/b/s")

2. MyAttempt.[but still needs Setting some switches.....]

_DOSDir($s_Path,$s_Mask,$s_AnswerFile,$s_Switches,$Recurse)

3. An attempt needing NO dos knowledge;[but not so complex an example as those above...]

_DOSDirSortByName($s_AnswerFile,$s_Path,$s_Mask,$Recurse,$Reverse,$NameOnly)

EDIT - re-worded in case of mis-understanding! - Keep it coming!..... Edited by randallc
Link to comment
Share on other sites

  • 1 year later...

Hi guys,

I know this is something of a Do based problem but I'm asking on here because I want to build it into my autoIT script.

I'm trying to use the _rundos() function to start a program (because its not an executable I can't use Run() ) Below you can see that part of my script:-

_RunDos("start C:\Program Files\HostExplorer.nt\user\hostex\Profile\3270\Default.HEP")

It seems that the script won't work because Dos can't understand the file extension (I assume because of the space after the C:\Program). I've tried defining my path as $file and including that but it didn't work, and also using quotations marks but that also fails (although its likely its the way I'm writing the command causing this to fail)

I was wondering if anybody could tell me the solution to this problem as it is causing a problem anytime I try and use a Dos command in my scripts.

Thanks

Mark

Hello Locutus243

Have you tried something like this? Sorry is it was already mentioned.

Case $msg = $ttbutton
ShellExecute ( "Default.HEP","", " EITHER %HOMEPATH%\Hummingbird\??? OR C:\Program Files\Hummingbird\Connectivity\10.00\HostExplorer\","", )

The %HOMEPATH%\Hummingbird\??? would take your command to the

C:\Documents and Settings\user\Hummingbird\??? whatever area...

Edited by gesller
Link to comment
Share on other sites

  • 5 weeks later...

Dude! That's some serious topic resurrection there! :)

Yep, I just came into the picture and threw in my 2 cents.. LOL actually with hummingbird I have foiund a better way. It is setup as a system app when installed so you can just use this in your command lind.

HOSTEX32.EXE -P ?????.HEP -H XXX.XXX.XXX.XXX


-P IS THE PRIFILE YOU WANT TO RUN
-H IS THE HOST IP

and this will dynamically open a new session based on the profile you see here as ?????.HEP

Just talking tho.. LOL Not trying to reopen the subject... :)

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