beste,
ik heb een vraag die volgens mij best ingewikkeld is.
op mijn stage plek heb ik een update server gemaakt, dit omdat hier geen domein is en ze dit ook niet willen aan schaffen heb ik deze manier bedacht:
1 script op de pc als die opstart :
aan deze code hoeft nooit iets verandert te worden!!!
maar nu komt het 2de als dus Nasversion.txt niet overeen komt met die van de update server laat hij dit script lopen:
nu is mijn oude stage begleider niet zo handig met dos commando's
mijn vraag is dus is er een manier om een progje te schrijven zodat bijv.
als er aan gevinkt word copy in het programma dat er in een tekst file weg geschreven word:
copy \\
en dan in het programma het bestand aan gegeven moet worden dus de locatie en waar het bestand naar doe moet dat er dan komt te staan:
copy \\bestandpad\mapje\naam.exe "d:\"
is dit mogelijk zo ja hoe doe ik dit?
alvast bedankt voor jullie hulp.
(ps ik ben al klaar op deze stage plaats dus dit is geen school opdracht!!)
ik heb een vraag die volgens mij best ingewikkeld is.
op mijn stage plek heb ik een update server gemaakt, dit omdat hier geen domein is en ze dit ook niet willen aan schaffen heb ik deze manier bedacht:
1 script op de pc als die opstart :
Code:
Dim filesys, file, moddate1, moddate2
Set filesys = CreateObject("Scripting.FileSystemObject")
Set file = filesys.Getfile("d:\nasversion.txt")
moddate1 = file.DateLastModified
set file = filesys.Getfile("\\otwmnas\update\nasversion.txt")
moddate2 = file.DateLastmodified
if moddate1 < moddate2 Then
Dim objshell
set objshell = Wscript.CreateObject("WScript.Shell")
objShell.Run "\\otwmnas\update\test2.cmd"
end if
aan deze code hoeft nooit iets verandert te worden!!!
maar nu komt het 2de als dus Nasversion.txt niet overeen komt met die van de update server laat hij dit script lopen:
Code:
@echo ******** chrome installatie **************
if not exist "d:\ChromeStandaloneSetup.exe" (
copy \\otwmnas\update\Chrome\ChromeStandaloneSetup.exe "d:\" /y
copy \\otwmnas\update\Chrome\ChromeStandaloneSetup.exe "d:\" /y
start d:\ChromeStandaloneSetup.exe )
@echo ******** Achtergrond installatie ***************
if not exist "d:\image.bmp" (
copy \\otwmnas\update\wallpaper\image.bmp "D:\" /y
copy \\otwmnas\update\wallpaper\image.bmp "D:\" /y
copy \\otwmnas\update\wallpaper\image.bmp "C:\\Documents and Settings\\Administrator\\Local Settings\\Application Data\\Microsoft\\" /y
copy \\otwmnas\update\wallpaper\image.bmp "C:\\Documents and Settings\\Administrator\\Local Settings\\Application Data\\Microsoft\\" /y
regedit -s \\otwmnas\update\wallpaper\wallpaper.reg
)
if not exist "d:\orbis.theme" (
copy \\otwmnas\update\wallpaper\orbis.theme "d:\" /y
copy \\otwmnas\update\wallpaper\orbis.theme "d:\" /y
start d:\orbis.theme
)
@echo ********* Bookmarks chrome *******************
copy \\otwmnas\update\Chrome\Bookmarks\Bookmarks "C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\User Data\Default\" /y
copy \\otwmnas\update\Chrome\bookmarks\Bookmarks "C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\User Data\Default\" /y
copy \\otwmnas\update\Chrome\Settings\Preferences "C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\User Data\Default\" /y
copy \\otwmnas\update\Chrome\Settings\Preferences "C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\User Data\Default\" /y
@echo ***************** printers ******************
IF EXIST RUNDLL32 printui.dll,PrintUIEntry /n \CanonStationpleinEtage2 /dl
IF EXIST RUNDLL32 printui.dll,PrintUIEntry /n \CanonStationpleinEtage3 /dl
IPCONFIG |FIND "IP" > %temp%\TEMPIP.txt
FOR /F "tokens=2 delims=:" %%a in (%temp%\TEMPIP.txt) do FOR /F "tokens=1,2,3 delims=." %%b in ("%%a") do set SUBNET=%%b.%%c.%%d
del %temp%\TEMPIP.txt
set SUBNET=%SUBNET:~1%
if "%SUBNET%"=="10.101.10" (
regedit -S \\otwmnas\update\printers\printerport_10.101.10.reg
regedit -S \\otwmnas\update\printers\Printer1.reg
regedit -S \\otwmnas\update\printers\Printer2.reg
regedit -s \\otwmnas\update\printers\defaultprt.reg
) else (
regedit -S \\otwmnas\update\printers\CanonIr1024i.reg
)
if "%SUBNET%"=="10.101.2" regedit -S \\otwmnas\update\printers\printerport_10.101.2.reg
if "%SUBNET%"=="10.101.3" regedit -S \\otwmnas\update\printers\printerport_10.101.3.reg
if "%SUBNET%"=="10.101.4" regedit -S \\otwmnas\update\printers\printerport_10.101.4.reg
if "%SUBNET%"=="10.101.5" regedit -S \\otwmnas\update\printers\printerport_10.101.5.reg
if "%SUBNET%"=="10.101.6" regedit -S \\otwmnas\update\printers\printerport_10.101.6.reg
if "%SUBNET%"=="10.101.7" regedit -S \\otwmnas\update\printers\printerport_10.101.7.reg
if "%SUBNET%"=="10.101.8" regedit -S \\otwmnas\update\printers\printerport_10.101.8.reg
IF EXIST RUNDLL32 printui.dll,PrintUIEntry /n \CanonStationpleinEtage2 /dl
IF EXIST RUNDLL32 printui.dll,PrintUIEntry /n \CanonStationpleinEtage3 /dl
@echo *************** cardreader installatie *********************
if not exist "C:\Program Files\A.E.T. Europe B.V\SafeSign\Management Utility\tokenadmin.exe" (
msiexec /i \\otwmnas\update\Cardreader\safesign.msi /quiet /qn /norestart
) else (
if not exist "C:\Program Files\HID Global\OMNIKEY 3x21\readme_cm3x21.txt" (
msiexec /i \\otwmnas\update\Cardreader\OMNIKEY3x21_x86_for_R1_2_2_8.msi /quiet /qn /norestart
)
)
@echo *********** afsluiting van de update *****************
copy \\otwmnas\update\nasversion.txt "d:\" /y
copy \\otwmnas\update\nasversion.txt "d:\" /y
nu is mijn oude stage begleider niet zo handig met dos commando's

mijn vraag is dus is er een manier om een progje te schrijven zodat bijv.
als er aan gevinkt word copy in het programma dat er in een tekst file weg geschreven word:
copy \\
en dan in het programma het bestand aan gegeven moet worden dus de locatie en waar het bestand naar doe moet dat er dan komt te staan:
copy \\bestandpad\mapje\naam.exe "d:\"
is dit mogelijk zo ja hoe doe ik dit?
alvast bedankt voor jullie hulp.
(ps ik ben al klaar op deze stage plaats dus dit is geen school opdracht!!)