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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Thanks
0
RobSampsonCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bianchi928Author Commented:
Top
0
RobSampsonCommented:
Thanks for the grade.

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

Rob.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.