Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NAS access
#1
Hi gintaras,

i'd like to acces a NAS from Qm, to be able to do file operations

Using FileDelete directly fails because of the lack of access to the NAS (need to have credential access to it before using QM on it)

Any clues?

TY
#2
I cannot test. Is it possible to map NAS to a drive letter? Then you can try this:

Macro map (connect) network drive2
Code:
Copy      Help
;Note: there are separate mappings for standard user and admin. If QM is admin, the mapping is not in Windows Explorer, and is not visible to non-admin programs.

Wsh.WshNetwork n._create
VARIANT v(1) user("...") password("...")
n.MapNetworkDrive("N:" "\\server\share\folder" v user password)

out dir("N:\file.exe")
10

;Wsh.WshNetwork n._create
;VARIANT v=1
n.RemoveNetworkDrive("N:" v v)
#3
nope, NAS is under network section of Windows Explorer, names "\\Synology", ip known = 192.168.1.27
#4
I am not familiar with NAS. Try to find something in stackoverflow etc, then I can help to convert to QM.
#5
ok...

Related question in fact is somewhere else...

I'm fed up with the stupid way windows 7 and above enumerates all files and folders before making a deletion, which takes ages for my large NAS folders....
As NAS are way slower than SSD, i search for a way to do an unconditional delete of large folders, without the fuss of 15 minutes of crappy enumeration
by windows...

Do you know a way (btw, using browseforfolder QM function does give access to the NAS)...
#6
http://stackoverflow.com/questions/2399 ... ith-python

maybe this a beginning?
#7
Did you try NET USE with RunConsole2?
#8
nope, a little push would be appreciated though

as said, browseforfolder does ask for credential, I think I could then do operations on NAS files (not tested though)
#9
Macro Macro2760
Code:
Copy      Help
RunConsole2(F"NET USE P: \\<SERVER IP>\<PATH> {password} /USER:{user_name}")
#10
no joy...


Macro Macro12
Code:
Copy      Help
RunConsole2(F"NET USE P: \\192.1681.27:8245\ {pass} /USER:{user}")


system error 53

network path not found
#11
I don't know if this is worth something.

Maybe you should remove the final backslash in:
\\192.1681.27:8245\

If you have sufficient rights on the pc you are working on, you could try to add an credential:
Control Panel >> User Accounts and Family Safety >> Credential Manager , then select blue textlink "Add a windows credential"
Enter the IP adress: 192.1681.27:8245 (no backslashes).
And the user and password you have.
Now you do not have to provide user and password in the runconsole command.
(at least I do not have to use it in the windows command-line, so I think the same goes for the QM command runconsole2)
#12
TY r0n, but i don't have time to struggle with this, as browseforfiles does allow me to enter credentials and work with the desired directory...so i don't mess with command line anymore for the time being..

BTW Gintaras, any ideas to help for the windows delete flaws in QM (see previous posts)
#13
I know only two Windows API to delete files.
SHFileOperation - used by del. Supports Recycle Bin. Also there is a related COM interface, I think it is the same.
DeleteFile - used by FileDelete. Should be slightly faster.

Also there are Windows command-line programs, can be executed with run or RunConsole2:
http://superuser.com/questions/19762/mas...in-windows
http://stackoverflow.com/questions/18673...in-windows
...
#14
i'm stuck because rmdir or del are not found when used with runconsole2 :/
#15
They must be executed in command prompt (cmd.exe) or in a .bat file.
To run cmd.exe and execute rmdir:

Macro Macro2761
Code:
Copy      Help
str s=
;cmd.exe /C "rmdir /s/q "c:\test\rmdir""
RunConsole2 s

cmd.exe help:
Code:
Copy      Help
RunConsole2 "cmd.exe /?"
#16
ahhh ok, thought runcosole would handle it directly!!!

my bad, thanks for pointing me out!

standing corrected and educated, thanks Gintaras!
#17
ok, got back to filedelete procedure, dos commands don't seem THAT much faster


Forum Jump:


Users browsing this thread: 1 Guest(s)