Jump to content

Recommended Posts

Posted

I have to modify a script to create a folder on the desktop and share with everyone if it does not exist on a Windows 7 PC - No Domain. Here is the script, need help at bottom

=======================================================

Set objShell = CreateObject("WScript.Shell")

objComputer=objShell.ExpandEnvironmentStrings("%ComputerName%")

IF Right(objComputer,3) = "000" Then

Else

strShortcut = objShell.SpecialFolders( "Desktop" ) & "\%username% Share.lnk"

strShortcut = objShell.ExpandEnvironmentStrings(strShortcut)

Set objLink = objShell.CreateShortcut( strShortcut )

objComputer=objShell.ExpandEnvironmentStrings("%ComputerName%")

objServer=Left(objComputer,7) & "-000"

objLink.Description = objShell.ExpandEnvironmentStrings("%username% Share")

objLink.TargetPath = objShell.ExpandEnvironmentStrings("\\" & objServer & "\Users\%username%\Desktop\%username% Share")

objLink.Save

End If

=======================================================

if "C:\Users\%username%\desktop\%username% Share" exits do nothing

if not create the folder and share it with everyone read only

======================================================

The section directly above is what I need to add, anyone have a clue how to make this work?

Posted

Nick, Thanks for the reply. I can't us GPO (not on a domain) and this script runs on a Wndows 7 pro PC. It is in an image that gets rolled out every few weeks. If I can figure out the last part here with creating a folder and sharing it to everyone, it will save me hours of work a week.

 

- - - Updated - - -

 

Nick, Thanks for the reply. I can't us GPO (not on a domain) and this script runs on a Wndows 7 pro PC. It is in an image that gets rolled out every few weeks. If I can figure out the last part here with creating a folder and sharing it to everyone, it will save me hours of work a week.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...