Windows Thread, Check if a profile exits....help in Technical; Hello all, I need a short script that will check if a user profile is present on the local C: ...
1. Check if a profile exits....help

Hello all,
I need a short script that will check if a user profile is present on the local C: drive, and if it is it will then do a task.

I was thinking along the lines of:-

Or

If exits “C:\Documents and Settings\%username%” then……

But it seems to be falling over with the following error after it is run…..

C:\users\student1 was unexpected at this time

So the user name is identified but the script stops

Any ideas?

Thanks

John

2. Is it a VBS script?

If so stick this at the top

Code:
On error resume next

Maybe the thread should be moved here: http://www.edugeek.net/forums/scripts/

If not exist C:\path\to\profile goto end

Command you want if it does exist

End

example

Code:
if not exist C:\user\student goto end

xcopy C:\user\student \\server\share /d /g /h

end

just change the xcopy command to whatever you would like to do with it

4. Have you just made a typo copying it here? You've used "exits" but you need "exist" (no S at the end; S in the middle)

(note if you do move to VBScript then it becomes "fileexists" or "folderexists" - there is an S on the end)

Otherwise, I can't see anything wrong with what you've got - it should work

SHARE: