nathanjame
(Just in Town)
2018-05-07 11:46 AM
Creation shares with KIXTART

Hi,

I'm going crazy!
I want to create a share from a value retrieved from the
registry.
The value is a directory of the type c: documents and settingtoto my
documents
The recup of the value does it well.
on the other hand impossible to create sharing.

Where did I plant?
The problem seems to come from the fact that the path has spaces, that's
why I put the variable between "" when passing the
NET SHARE command .

Here is the part that goes wrong in my script


$ TEST = readvalue ("HKEY_CURRENT_USERsoftwaremicrosoftwindowscurrentversion
explorershell folders", "personal"

$ TEST
?
RUN "NET SHARE BACKUP =" $ TEST ""


Thanks in advance for your help


BradV
(Seasoned Scripter)
2018-05-07 11:54 AM
Re: Creation shares with KIXTART

Why do you have a space between '$' and 'TEST?'

ShaneEP
(MM club member)
2018-05-07 05:54 PM
Re: Creation shares with KIXTART

Also missing some slashes and a closing parenthesis. Hopefully this is just a copy/paste error.

ShaneEP
(MM club member)
2018-05-07 06:19 PM
Re: Creation shares with KIXTART

Perhaps give this a shot.

 Code:
$TEST = ReadValue("HKEY_CURRENT_USER\software\microsoft\windows\currentversion\explorer\shell folders","personal")

$cmd = '%comspec% /c NET SHARE BACKUP="' + $TEST + '"'

Shell $cmd