Jump to content

Map Drives Mistery


Recommended Posts

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

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 - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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 contains

b_drive=\\naris.net\usteeh-ds\intl

Link to comment
Share on other sites

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 - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...