Add/Pass Username Password to Rename function to

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 14 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
ismailc
Posts: 37
Last visit: Tue Jun 09, 2015 12:16 am

Add/Pass Username Password to Rename function to

Post by ismailc »

Good day, I need help.

I have a simple rename function that works on my PC & on the server where my site is situated.The files I rename are on the network, but when i execute the script within my site - "Permission Denied"

Is there a way to add/pass Username & Password to the below script to grant me permission to rename file.

I think the site does not see the location becuase I can execute the vbs file on the server the site resides but once on the site (web) then i get the error

Code: Select all

Set objFSOFILE = CreateObject("Scripting.FileSystemObject")
objFSOFILE.MoveFile "srv09-za999FolderTesttemp2.txt" , "srv09-za999FolderTesttemp3.txt"

Please Assist!
User avatar
jhicks
Posts: 1789
Last visit: Mon Oct 19, 2015 9:21 am

Add/Pass Username Password to Rename function to

Post by jhicks »

If this is code that is running as part of a web page on an IIS server, then you'll need to check permissions on the file share and make sure the IUSR account has write permissions (or whatever account you might be using on the web server)
User avatar
jhicks
Posts: 1789
Last visit: Mon Oct 19, 2015 9:21 am

Add/Pass Username Password to Rename function to

Post by jhicks »

Back in the day doing this sort of thing from a web page was easier, but security and permissions have become much more restrictive and personally I tell people to avoid running administrative scripts from a web server, especially those using WMI. There are simply too many holes you have to punch through and unless you know exactly what you are doing, you theoretically make yourself more vulnerable. But I'm glad it worked.
User avatar
ismailc
Posts: 37
Last visit: Tue Jun 09, 2015 12:16 am

Add/Pass Username Password to Rename function to

Post by ismailc »

I needed to rename the files in sthe site after a click of a button
By allowing a group access, when they navigate to the file location then they can modify the file.

Which i don't want it should only be modified by the button.

I have no hassles now

Regards
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Add/Pass Username Password to Rename function to

Post by jvierra »

YOu need to be aware that if you used IUSR account to allow write access then anyone in teh world cangain access to the files. IUSR is a low level proxy for anyome who can access the webserver even if they are not authenticated.
User avatar
ismailc
Posts: 37
Last visit: Tue Jun 09, 2015 12:16 am

Add/Pass Username Password to Rename function to

Post by ismailc »

Thank you my friend, i reverted to renaming the files via Web service


But i posted new problem i no longer have the Title, i must no either use some other column like "name" as i have the value of name but Name is only a display name in sharepoint

so i must do a get list id & then filter on "name" - this is my last resort
This topic is 14 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked