 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Yanah Guest
|
Posted: Mon Nov 27, 2006 9:43 pm Post subject: running batch files |
|
|
| Ok, if I've got a .bat file for-instance at c:\runonce.bat..... how in AHK, can I issue a command to Windows to run that file after re-booting? -~Y |
|
| Back to top |
|
 |
Tuncay
Joined: 07 Nov 2006 Posts: 384 Location: Berlin
|
Posted: Mon Nov 27, 2006 10:16 pm Post subject: |
|
|
Create an AutoHotkey script, say for example run_runonce.bat.ahk and put it in your AutoStart folder of Windows.
| Code: | | Run, "c:\runonce.bat", c:\ |
If you want hide the command line window:
| Code: | | Run, "c:\runonce.bat", c:\, hide |
Look at the help file for more informations about Run command in AutoHotkey. |
|
| Back to top |
|
 |
Yanah Guest
|
Posted: Mon Nov 27, 2006 11:23 pm Post subject: |
|
|
Hi Tuncay, Is there anyway to do this other than placing a file in a fixed location? |
|
| Back to top |
|
 |
Tuncay
Joined: 07 Nov 2006 Posts: 384 Location: Berlin
|
Posted: Mon Nov 27, 2006 11:46 pm Post subject: |
|
|
| Which file do you mean, the ahk script or the batch file? Where would you like to put the files? May be on a USB stick? |
|
| Back to top |
|
 |
AgentSmith15
Joined: 06 May 2005 Posts: 37
|
Posted: Thu Aug 02, 2007 6:38 am Post subject: |
|
|
I think Yanah is/was on a role.
Does anyone know of a way to run batch commands from within a AHK script? |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1028 Location: switzerland
|
Posted: Thu Aug 02, 2007 10:38 am Post subject: |
|
|
| Code: | RU3=C:\TEST
ifnotexist,%RU3%
FileCreateDir,%RU3% ;creates a folder c:\test
F1=%RU3%\b.bat ;filename
SplitPath,F1,name, dir, ext, name_no_ext, drive
filedelete,%F1% ;delete file b.bat
fileappend,dir c:\windows /s,%F1% ;creates b.bat with command dir c:\windows /s
SplitPath,F1,name, dir2, ext, name_no_ext, drive
msgbox,%DIR2% ;this a the workingdir
;Run, Target [, WorkingDir, Max|Min|Hide|UseErrorLevel, OutputVarPID]
;runwait,c:\test\b.bat, c:\test\, hide ;hidden
;run,%comspec% /K %F1%,%RU3% ;start DOS command b.bat with workingdir
run,%comspec% /K %F1%,%DIR2% ;start DOS command b.bat with workingdir
exitapp
|
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|