Sign in to follow this  
Followers 0
jp10558

Windows 7x64 and inireadsections to mapped drive

5 posts in this topic

I've got a script where I'm using DriveMapAdd to map a drive to a remote system. This succeeds. I then use psexec to run a remote command. This also succeeds. This remote command creates an ini file on the remote computer. Then in the script I call IniReadSections on the ini file and get @error set. It's like the script cannot read the remote file, but manually I can see the ini fine from the computer where I'm running the script. I've tried two different Win7 PCs as well as rebooting to clear out mapped drive cruft. Is this just a Windows thing? Any Ideas?

Share this post


Link to post
Share on other sites



What does your ini look like, maybe it's not set up correctly and the script can't get the section names (variable for section name different from what's in the ini)?


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

Here's an example:

[suRun]

Version=1.2.0.8

BlurDesk=1

FadeDesk=1

SavePW=1

UseCancelTimeOut=1

CancelTimeOut=40

ShowCancelTimeOut=0

PwTimeOut=5

AdminNoPassWarn=2

CtrlAsAdmin=0

CmdAsAdmin=0

ExpAsAdmin=0

RestartAsAdmin=1

StartAsAdmin=0

HideExpertSettings=0

UseIShExHook=0

UseIATHook=0

TestReqAdmin=0

ShowAutoRuns=0

ShowTrayAdmin=10

UseWinLogonDesk=1

NoConvAdmin=1

NoConvUser=1

DefHideSuRun=0

[user0]

Name=DOMAIN\user

IsLocalUser=0

NoRunSetup=1

RestrictApps=1

InstallDevs=0

UserTSA=1

HideFromUser=0

ReqPw4Setup=0

[WhiteList0]

0="C:\WINDOWS\system32\control.exe hdwwiz.cpl"

1="C:\WINDOWS\system32\mmc.exe devmgmt.msc"

2="C:\WINDOWS\system32\rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL AddPrinter"

3="C:\WINDOWS\system32\rundll32.exe shell32.dll,Control_RunDLL powercfg.cpl"

[WhiteListFlags0]

0=1

1=1

2=0

3=0

Share this post


Link to post
Share on other sites

try this on your actual ini file... compare the results of the arrays with your script.

#include<Array.au3>
$section=IniReadSectionNames(@ScriptDir&"\test.ini")
_ArrayDisplay($section)
For $i=1 to UBound($section)-1
    $content=IniReadSection(@ScriptDir&"\test.ini",$section[$i])
    _ArrayDisplay($content)
Next

I copied your example to test.ini and the arrays looked fine.


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

Yea, that test works - but I think it must be related to Windows Permissions... Have you ever seen a script fail to be able to access a network share after it successfully creates a mapped drive?

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