Questions tagged [net-use]

Net-use connects or disconnects a computer or a shared drive and controls net connections.

Net-use connects or disconnects a computer or a shared drive and controls net connections.

121 questions
0
votes
0 answers

Batch: Net share and Net use error

I'm trying to connect to my other pc, with net share and net use commands, sadly, I can't figure out how to make it work. Here are the codes: SHARE: sc config lanmanserver start= auto net start lanmanserver net user Test 1234 /add net localgroup…
MortenOrum
  • 17
  • 6
0
votes
1 answer

Unable to connect to remote shared path through xp_cmdshell

I am trying to copy a file from a remote path to my local machine using xp_cmdshell in SQL management studio. The following are the steps i use: 1. Establish a connection exec xp_cmdshell 'net use L: \\remoteServer\folder /user:domain\username…
Linda
  • 147
  • 2
  • 20
0
votes
0 answers

How to mitigate OS Command Injection for runtime.exec in JAVA

In my java class I am running following command for establishing a network connection to server like: Process process = runtime.exec("net use \"\\\\External\path\download.zip\" password /user:username"); Above, password and username are accepted…
quintin
  • 812
  • 1
  • 10
  • 35
0
votes
0 answers

Drive mapping unavailable when added via registry

I want to add drive mapping from my c# app for specific user on remote machine. I'm trying to do it by adding new registry key. When I add new drive mapping in registry, adding new key in: HKEY_USERS\< USER >\Network so, for example, to map…
Jac Mos
  • 7,746
  • 4
  • 15
  • 21
0
votes
2 answers

batch file net use with for output for variable if

I have code for mapping drive in windows with batch file, i use parameter like nik and password. Then if the user and password match the program will give output "Success" and else it the program will give output "some error". The parameters for…
ikwijaya
  • 83
  • 11
0
votes
0 answers

Assign User to net use to change another users password

Is it possible to assign a user to make net use run as a certain person(admin) to change another users password? Like so?: "/c net user /user:domain\Administrator username password /domain" Maybe some how using a runas or something to…
David Brierton
  • 6,977
  • 12
  • 47
  • 104
0
votes
0 answers

Map a network drive for a different user using psexec -s with their password

I know how to map a network drive using net use and psexec. Out of convenience for my users, I don't want to make them do anything, really. Just request the share and that's it. I want to do the rest without inconveniencing their work at all - in…
host_255
  • 361
  • 2
  • 7
  • 18
0
votes
2 answers

How can I check if a drive was successfully mapped with net use in C#?

I tried testing if the directory exists after executing the net use command, but checkMappedDrive() is executing before mapDrive() finish mapping the drive. public void mapDrive(String driveChar, String server, String user, String password){ …
tec
  • 999
  • 3
  • 18
  • 40
0
votes
2 answers

Windows batch/cmd file to extract network drives (strings between delimiters)?

I have backed up the network drive to an xml file in the format below. X \\DANIEL-HP\Users\Public\Documents\Downloaded Data Sheets Y
DannyBoi
  • 636
  • 1
  • 7
  • 23
0
votes
1 answer

C# Regex: Check if the given directory in a net use command contains whitespaces

I am programming a tool to standardize batch-files and I use a regular expression to validate every net use command in it. I'm stuck at the directory that is given to the command. The standard syntax of the command in this case is: net use…
0
votes
1 answer

Mount SMB-shares from Hudson's job: ERROR 1326

In the building system I use some script that copies files from a network drive to the Hudson's workspace by using SMB. Then performs decompression it and deletes the old files. net use \\NET_DRIVE\ipc$ /user:admin password robocopy…
user1134181
0
votes
1 answer

Unable to use cmdkey and net use to a Azure file share on Windows 10

I'm trying to follow the instructions on how to create a persisted connection to an Azure Storage File Share. However from my Windows 10 machine I cannot get the cmdkey / net use combination to work: C:\>cmdkey…
antmeehan
  • 865
  • 9
  • 11
0
votes
1 answer

Command prompt executing command differently than batch file and Visual Studio post-build script

I have a post-build script in Visual Studio that I am trying to run so that we can make remote deployments easier. Earlier in this script (you don't see it here), we hard-code the user in the net use execution below. So all we're doing here is…
0
votes
2 answers

If statement in batch and app not recognized anymore

I try to access some Excel data stored on a server and copy these files to another server ; the destination path should be different with the name of the file. Here is my code : setlocal enabledelayedexpansion net use Z: \\10.0.0.1\Statistiques set…
J. Grunder
  • 143
  • 2
  • 13
0
votes
1 answer

Powershell - net use doesn't work with variables

I'm trying to get a script running that maps network drives at login. Generally, I use get-content with | convertfrom-stringdata to put my parameters (drive letter and path) in a hash. My problem is the following: net use /persistent:no $driveletter…
blaargh
  • 33
  • 1
  • 10
1 2 3
8 9