Forum » Programiranje » script za premaknit fajl
script za premaknit fajl
navigator ::
Zanima me kako bi lahko v win 2k naredil programcek, ki bi vzel na doloceni lokaciji dolocen fajl in ga skopiral na drugo lokacijo, izvorni fajl pobrisal in na koncu zagnal se en program.
Hvala !
Hvala !
rc-car ::
Ok, batch fajlov že dolgo nisem gledal, naj bi pa zgledalo nekako takole (pišem iz glave, tako da je možna kje kaka napaka):
@echo off
copy %1 %2
del %1
%2
%1
Program pa potrebuje dva parametra in sicer 1. ime fajla in 2. nova lokacija
@echo off
copy %1 %2
del %1
%2
%1
Program pa potrebuje dva parametra in sicer 1. ime fajla in 2. nova lokacija
Nothings gonna stop me now, I'm breaking the rules, I'm gonna do it if its not allowed
Gandalfar ::
C:\>move /?
Moves files and renames files and directories.
To move one or more files:
MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination
To rename a directory:
MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2
[drive:][path]filename1 Specifies the location and name of the file
or files you want to move.
destination Specifies the new location of the file. Destination
can consist of a drive letter and colon, a
directory name, or a combination. If you are moving
only one file, you can also include a filename if
you want to rename the file when you move it.
[drive:][path]dirname1 Specifies the directory you want to rename.
dirname2 Specifies the new name of the directory.
/Y Suppresses prompting to confirm you want to
overwrite an existing destination file.
/-Y Causes prompting to confirm you want to overwrite
an existing destination file.
zakaj bi izumljali toplo vodo :>
Moves files and renames files and directories.
To move one or more files:
MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination
To rename a directory:
MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2
[drive:][path]filename1 Specifies the location and name of the file
or files you want to move.
destination Specifies the new location of the file. Destination
can consist of a drive letter and colon, a
directory name, or a combination. If you are moving
only one file, you can also include a filename if
you want to rename the file when you move it.
[drive:][path]dirname1 Specifies the directory you want to rename.
dirname2 Specifies the new name of the directory.
/Y Suppresses prompting to confirm you want to
overwrite an existing destination file.
/-Y Causes prompting to confirm you want to overwrite
an existing destination file.
zakaj bi izumljali toplo vodo :>
Ziga Dolhar ::
Gandalf, tole kar si napisal, je le prototip delčka potrebne kode (kot v zgoraj napisanem batchu.) Le, da je tam copy, ti si pa dal move.
MadMax ::
izvorni fajl pobrisal
zato je move namesto copy.
zato je move namesto copy.
Stvari so preproste, le ljudje smo neverjetni mojstri, da jih zakompliciramo.
ABX ::
Lahko še dodaš en IF da ne bo vračalo napak.
IF EXIST file.log (move file.log c:\temp)
exit
IF EXIST file.log (move file.log c:\temp)
exit
Vaša inštalacija je uspešno spodletela!
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | MS-DOS/cmd xcopyOddelek: Operacijski sistemi | 1626 (1488) | DeeJay |
» | BAT kopiranje mapeOddelek: Pomoč in nasveti | 1561 (1429) | StratOS |
» | Gigabitni switch za domaco uporabo?Oddelek: Kaj kupiti | 2076 (1436) | lopov |
» | [Batch] xcopy ukazOddelek: Programiranje | 1549 (1361) | Ethical |
» | Dodajanje bližnice v meni desne tipke na miškiOddelek: Pomoč in nasveti | 1472 (1357) | vres.ales |