dewild1 0 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. Share this post Link to post Share on other sites
BrettF 28 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! Share this post Link to post Share on other sites
Glyph 2 Posted October 17, 2007 isn't it "_RunDos"?? tolle indicium Share this post Link to post Share on other sites
Blue_Drache 260 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 Share this post Link to post Share on other sites
weaponx 16 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 Share this post Link to post Share on other sites
Blue_Drache 260 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 Share this post Link to post Share on other sites
Bert 1,436 Posted October 19, 2007 Programing is a art...and a dark art at that! The Vollatran project My blog: http://www.vollysinterestingshit.com/ Share this post Link to post Share on other sites
dewild1 0 Posted October 19, 2007 I know, it can be fun to make things... But I would rather go out and play! Share this post Link to post Share on other sites