Gonzapa Posted May 25, 2011 Share Posted May 25, 2011 Hi I have a script that paps a network drive . When I run the script as as a regular user It works ok. If I run the same script using task manager on windows 2008 server. It gives me the following error Invalid remote share for the task I am using a user with administrator access so is not a security issue Anyone can point me in the right direction of why the script would not work runing as a task? here is the script: $rc = DriveMapAdd("b:", $b_drive) if $rc = 0 Then Select case @error = 1 $errm = "Undefined / Other error" case @error = 2 $errm = "Access to the remote share was denied" case @error = 3 $errm = "The device is already assigned" case @error = 4 $errm = "Invalid device name" case @error = 5 $errm = "Invalid remote share" case @error = 6 $errm = "Invalid password" EndSelect MsgBox(16+4096, "Network Connection Error " & @error & " (" & $errm & ")" & @CRLF & _ "Not possible to map the network drive " & $b_drive, 60) _FileWriteLog ($log,$errm &" "& $b_drive) EndIf EndIf Link to comment Share on other sites More sharing options...
water Posted May 25, 2011 Share Posted May 25, 2011 It tells us the remote share stored in $b_drive is invalid. Whithout knowing the content of $b_drive it's impossible to help. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Gonzapa Posted May 25, 2011 Author Share Posted May 25, 2011 It tells us the remote share stored in $b_drive is invalid.Whithout knowing the content of $b_drive it's impossible to help.here is the contents$b_drive = IniRead("CTX_REPL.INI", "global", "b_drive", "NotFound")ini file containsb_drive=\\naris.net\usteeh-ds\intl Link to comment Share on other sites More sharing options...
water Posted May 25, 2011 Share Posted May 25, 2011 Do you make sure in your script that $b_drive doesn't contain "NotFound"? Try to write $b_drive to a file and check the content. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now