English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Its on my desktop and i have tried and failed

2007-03-27 07:53:12 · 5 answers · asked by Anonymous in Computers & Internet Software

I would rather do this using a command line, so it does it automaticaly

2007-03-27 08:07:03 · update #1

5 answers

You can do this by calling a second command processor from inside your original batch file and using the copy command.

Here's my test.bat file that illustrates this. To make it do something first, I have it list a directory of c: then it copies itself to the "All Users" startup folder.

===================
@echo off
cls
dir c:\

start cmd /c copy "c:\documents and settings\all users\desktop\test.bat" "c:\documents and settings\all users\start menu\programs\startup\"

=============
(the whole "start" and "copy" command should be on one single line. Yahoo Answers wraps stuff)

To test this code, save the code as a batch file called test.bat to the "All Users" desktop, then open a command window, change to the "All Users" desktop directory. When you execute the batch, it will list the contents of your c: drive, then create a copy of itself in the All Users startup folder.

For your particular batch file, you would need to add the final line that opens a second command processor and does the copy, and also edit the source location of your batch file, which is probably in your own user profile directory instead of in the All Users profile.

2007-03-27 12:41:04 · answer #1 · answered by Kevin 7 · 5 0

placed it into the folder manually. Drag it over to the initiate menu. i don't recognize ways can a batch record replica itself into the initiate menu if its already there. Im not on my homestead windows pc now in spite of the shown fact that it might bypass some thing like this: @echo off replica batch.bat C:WindowsStartup pause yet whilst the record is already being copied into the startup folder, this line will do not something.

2016-10-20 13:25:51 · answer #2 · answered by ? 4 · 0 0

Put it into the folder manually. Drag it over to the start up menu. I do not understand how can a batch file copy itself into the start up menu if its already there.

Im not on my windows computer now but it should go something like this:

@echo off
copy \batch.bat C:\Windows\Startup\
pause

But if the file is already being copied into the startup folder, this line will do nothing.

2007-03-27 08:03:05 · answer #3 · answered by Anonymous · 0 1

I would think you have to write the copy file as a program. The .bat might have command to launch the program and then quit. Win locks open files.

The program could be java, it looks for the .bat and then looks for startup folder, opens the .bat, file i/o. I did have code where java writes the .bat, assigns file.bat the .exe file permission and launch.

Are you trying to write a virus?

2007-03-27 08:08:43 · answer #4 · answered by Anonymous · 0 1

right click on folder and then press copy, go on startup menu and press paste. It should work.

2007-04-04 05:50:07 · answer #5 · answered by Anonymous · 0 0

fedest.com, questions and answers