However, this puts a lot of rubbish on the screen. If you wanted to create a backup of that file then you would write the following. This takes the contents of one file and puts it in another. To loop through every file in a directory you need to use the following line. This code will loop through the contents of a directory and print out each file name to screen. This will also list the bat file that you put in the directory so another solution might be to run the bat file from the directory above and use the following code.
The following snippet of code takes the previous example and does something useful. First I got to 'Boston' and look around. You keep repeating yourself, but I still can't visualize what you are trying to do. Please answer my questions. What program is displaying this list of files and folders? If you select a folder, and right click the mouse, what do you expect to happen? How did you attach the batch file to the context menu.
As far as I know, this has to be done thru the registry. Is this what you did? Like I mentioned, a combination of VBScript and batch code can do this, but at this point I'm not sure what you really want.
Gotta go. The radio is playing Zeppelin's Dazed and Confused. You have to make some minor changes in the batch file you just created. In the code, type the actual values instead of the capital text. Save the batch file. Save the newly edited batch file and place it anywhere you want. Execute the file. Your specified file will be copied from its current location to the one you have specified in the destination address. Include your email address to get a message when this question is answered.
Helpful 0 Not Helpful 0. The file addresses must be properly enclosed in the quotations as specified in the code. The base file will remain on its original location, and will also be copied to its new location as specified in the batch file. Submit a Tip All tip submissions are carefully reviewed before being published. Don't usually use to copy folders with large data inside them. If you are just trying to copy a file from the current directory to a new one, you may simply do this: copy "Move.
This will have a problem if the batch script is run from a command line with a different working directory set. Ah I misunderstood the question then. Thanks — ghman. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog.
0コメント