DOS Commands in VBScript

I need help to have the following line run in ONE VBScript

Thanks
Cheers

cd\temp
copyprofile u104c7\newuser "c:\documents and settings\psr104a" retail\psr104a
copy "c:\documents and settings\newuser\desktop\*.*" "c:\documents and settings\psr104a\desktop"
copy "c:\documents and settings\newuser\desktop\*.rdp" "c:\documents and settings\all users\start menu\programs\startup"
net use H: \\auprifile01\psr104a\my_documents /persistent:yes

Thanks
Cheers
Bianchi928Asked:
Who is Participating?
 
RobSampsonConnect With a Mentor Commented:
Hi,

I've assumed that the newuser profile is already on the current PC, so you won't need a prompt for that.

Regards,

Rob.
Set objShell = CreateObject("Wscript.Shell")
Set objNetwork = CreateObject("WScript.Network")
strProfile = InputBox("Enter your username: eg psr104a", "Username", "")
objShell.Run "cmd /c \\server\share\copyprofile " & objNetwork.ComputerName & "\newuser ""c:\documents and settings\" & strProfile & """ retail\" & strProfile, 1, True
objShell.Run "cmd /c copy ""c:\documents and settings\newuser\desktop\*.*"" ""c:\documents and settings\" & strProfile & "\desktop\""", 1, True
objShell.Run "cmd /c copy ""c:\documents and settings\newuser\desktop\*.rdp"" ""c:\documents and settings\all users\start menu\programs\startup\""", 1, True
objShell.Run "cmd /c net use H: \\auprifile01\" & strProfile & "\my_documents /persistent:yes", 1, True

Open in new window

0
 
Bianchi928Author Commented:
I forgot to mention taht i need a prompt for u104c7 (Computername) & psr104a (username)

Thanks
0
 
Bianchi928Author Commented:
Top
0
 
RobSampsonCommented:
Thanks for the grade.

When you use CopyProfile, does it apply the correct securities to the profile?

Rob.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.