Jump to content
Sign in to follow this  
Gonzapa

Map Drives Mistery

Recommended Posts

Gonzapa

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
water

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 (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Gonzapa

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
water

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 (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
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  

×