Category Archives: MS Scripting

Kako mapirati mrežne pogone z uporabo VBS skript? / How to map network drives using VBS scipt?

Na spodnjem naslovu lahko poberete dva primera skript za mapiranje pogonov. Prva enostavno mapira tri omrežne pogone, druga pa tudi spremeni imena pogonom.
The following two links consist of two VBS scripts that allow you to map network drives. First one just maps the drives. The second scripts allow you to change/rename the drive name.

mapnetworkdrives01.vbs
mapnetworkdrives02.vbs

How do I remove all files and sub-directories from a folder, without removing the folder?

@echo off
if {%1}=={} @echo Syntax: DelTree Folder&goto :EOF
if not exist %1 @echo Syntax: DelTree Folder – Folder %1 does not exist.&goto :EOF
pushd %1
if %ERRORLEVEL% NEQ 0 @echo Syntax: DelTree Folder – Folder %1 does not exist.&goto :EOF
del /q /f “*.*”
for /f “Tokens=*” %%i in (‘dir %1 /B /A /AD’) do rd /s /q “%%i”
popd