Sign in to follow this  
Followers 0
Gonzapa

Map Drives Mistery

4 posts in this topic

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

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0