Hi I need to copy some data to a folder.
But before copying I would like to check id fthe directory exists if not create it.
i finally this folder needs to be hidden.

Here is my script....for some reason it is not working..

$wksta = @WKSTA
$robocmd= %logonserver%\netlogon\tools\robocopy.exe
$roboparms= "/MIR \\bre1mb601\startmenu$\basis *.* h:\TS-MENU\ /r:0 /w:1 > nul"

;Opbouwen startmenu voor terminal server gebruikers


if $wksta = '0435xp' OR $wksta = 'bre1mb601' OR $wksta = 'bre1mb602'
IF exists (@homedir + "\ts-menu\")

else
shell '%comspec% /c md "h:\ts-menu"/s /q >nul 2>nul'

SETFILEATTR (h:\ts-menu, 2)
endif

Shell '%COMSPEC% /c '+$robocmd+' '+$roboParms

? 'copy succesfull....' ? ?
endif