| 1. |
Solve : go back in BAT? |
|
Answer» I am not sure how to search for this because i don't seem to get what i am looking for. do you mean that the batch file might be on a different drive?Is that directed at my? If so then it could be but the program dose many things and the file that it runs is on the same drive so that you can transport it to any computer and still fined and run the program. It is based of the fact that when moving a flash drive from one pc to another it will have a different drive letter.C:\>type drive.bat Code: [Select]@echo off REM Use command line argument REM drive.bat E %1: start %1:\FolderA\file Output: C:\> drive.bat E E:\>HUH? Is the objective to make this harder that it needs to be? You can always execute a batch file in another directory on the same drive. You can reference another file in another directory, even if the directory is not down in the current tree. Example: ..\folder\file.txt is a sideways reference to a file in a sister folder. \folder\folder\file.txt Is a reference from the root without SAYING which drive. (It has to be the current dive.) .\file.txt means this folder. Somewhere this is documented! Quote from: Geek-9pm on September 24, 2009, 01:42:08 PM
Wikipedia article title "Full stop"... Quote In Unix-like systems and Microsoft Windows, the dot character represents the working directory of the file system. TWO dots (..) represent the parent directory of the working directory. Wikipedia article title "Path (computing)". Quote Two dots ("..") point upwards in the hierarchy, to indicate the parent directory; one dot (".") represents the current directory itself. Both can be components of a complex relative path cd help Code: [Select]C:\>cd /? Displays the name of or CHANGES the current directory. CHDIR [/D] [drive:][path] CHDIR [..] CD [/D] [drive:][path] CD [..] MSDN page titled "File Names, Paths, and Namespaces" http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx I like to keep my projects very organized and not have duplicate files. So this is a pretty big piece to have working. In this small project i simply needed to run "sleep.exe". It worked perfectly. Thank you all for the input! Code: [Select]"..\exes\sleep.exe" 3 -HoFLQuote from: TheHoFL on September 24, 2009, 04:01:16 PM I like to keep my projects very organized and not have duplicate files. So this is a pretty big piece to have working. In this small project i simply needed to run "sleep.exe". It worked perfectly. HoFL, I have no idea what you are talking about. Sleep.exe? .. represents the current directory, up one. So "..\folder\name.bat" goes up one level, then looks in there for "folder" then GETS name.bat .Sleep.exe is a simply program that allows you to "pause" for a specified amount of seconds. It's like pause, but you don't have to hit a key to continue. It just starts after the amount if time specified. There is a sleep.com in this place: http://dslgeek.com/dos/there watch my video on youtube --> http://www.youtube.com/watch?v=mqhemoOVfuU than you know the code |
|