dewild1 Posted October 17, 2007 Share Posted October 17, 2007 Hi, I am used to AHK and I have spent an hour or two on just this, so please throw me a bone.. OK, trying to get a the current minute + 30 seconds to a variable to go into a line of code to be run in dos... Just like the example in help, but I added "$VAR" to guess,,,(I hope I am right)LOL , Run(@ComSpec & " /c " & 'commandName$VAR', "", @SW_HIDE)Anyways, here is what I am having trouble with, got the below code to add 30 sec, but I can not figure out this stuff.. MsgBox(0,$x,$MyTime[$x]) and I plan on switching the correct one for the $VAR above...#include <Date.au3> $sNewDate = _DateAdd( 's',30, _NowCalc()) MsgBox( 4096, "", "Date: " & $sNewDate ) Dim $MyDate Dim $MyTime _DateTimeSplit($sNewDate,$MyDate,$MyTime) For $x = 1 to $MyTime[0] [b]MsgBox(0,$x,$MyTime[$x])[/b] NextThank you, first impressions are I like it. Link to comment Share on other sites More sharing options...
BrettF Posted October 17, 2007 Share Posted October 17, 2007 Hi, Welcome to the forums First off, This is how you should run the DOS command. Run(@ComSpec & " /c " & $VAR, "", @SW_HIDE) Command$var, isn't something that will do anything in CMD... Also, you cannot call varibles in strings with the current way you are doing it. You could like: Opt ("ExpandVarStrings", 1) $VAR = "Netstat -a" Run(@ComSpec & " /c $VAR$", "", @SW_HIDE) MsgBox (0, "", "$var$") It is way eaiser to just do that the first way mentioned. Now for the last part, it appears you are calling the wrong varible? I'm not sure, but thats what it appears to be... It should be: #include <Date.au3> $sNewDate = _DateAdd('s', 30, _NowCalc()) MsgBox(4096, "", "Date: " & $sNewDate) Dim $MyDate Dim $MyTime _DateTimeSplit($sNewDate, $MyDate, $MyTime) For $x = 1 To $MyDate[0] MsgBox(0, $x, $MyDate[$x]) Next Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Glyph Posted October 17, 2007 Share Posted October 17, 2007 isn't it "_RunDos"?? tolle indicium Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 17, 2007 Share Posted October 17, 2007 Heya, welcome to AutoIt. Try taking a gander at the macros. Current time is found as such: Msgbox(0,"",@MON & "/" & @MDAY & "/" & @YEAR & @LF & @HOUR & ":" & @MIN & ":" & @SEC) Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
weaponx Posted October 19, 2007 Share Posted October 19, 2007 (edited) Encapsulate the entire string in single quotes and you won't have to use double-double quotes within it. Run('schtasks.exe /create /sc once /ru system /tn somename /Tr "c:\program files\911 pc fix . com\utils1\blabla.exe" /st ' & $var, "", @SW_MAXIMIZE) Edited October 19, 2007 by weaponx Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 19, 2007 Share Posted October 19, 2007 Don't hate programming, love programming. It's a much more gratifying teacher of patience than children. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Bert Posted October 19, 2007 Share Posted October 19, 2007 Programing is a art...and a dark art at that! The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
dewild1 Posted October 19, 2007 Author Share Posted October 19, 2007 I know, it can be fun to make things... But I would rather go out and play! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now