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

Python: How to store output in a shared folder path?

I am creating some QR images and wish to store in a shared folder path which requires username and password to access. qrFolder = '\\cmbpnh01-srv-03\Tidata\12. IT Projects\QR Code Creation\QA QR Code Creation' user = 'xxx\xxx' password =…
0
votes
0 answers

Mapping Drives To Your SQL Script NET USE

I do a lot of work with the file system in my SQL scripts. After a lot of effort, the only way I'm able to get all my network shares and NAS devices to be available to my SQL scripts is to start the script off with a "Net Use" command to map a drive…
jimerb
  • 67
  • 9
0
votes
0 answers

Using net use to configure a network share for access is not persisted when SQL Server (or the server) is restarted

We are doing the following to give SQL Server access to a network drive (using a specific username and password) to allow backups to be written to subdirectory2 on the network share networklocation: EXEC sp_configure 'show advanced options',…
Ian Hannah
  • 131
  • 1
  • 1
  • 10
0
votes
1 answer

Can I mapping network drive in very special way using winapi?

I have to start my application with admin privileges ( very important ). When I execute this code without admin privileges everything is perfect. There is an icon in MyComputer. NETRESOURCE nrServer; memset(&nrServer, 0, sizeof…
0
votes
1 answer

Batch file "net use *:" user and password autofill

is possible create batch file, that run command net use s: *some address* and then autofill the username and password? Something like this: if exist net use s: /delete set USER=userid set PASS=password net use s: *some address* Now cmd say "Enter…
Dominik Lev
  • 569
  • 5
  • 18
0
votes
1 answer

How to trigger a bat file on remote server only after the pssession is formed on the server

Write-Host "Welcome to Application Process Start/Stop Dashboard" -ForegroundColor Green Write-Host "`n" "1) Stop" "`n" "2) Start" [int]$resp = Read-Host "Choose option 1 or 2 for stopping or starting application process respectively" if($resp -eq…
0
votes
2 answers

Batch file user's last logon using net user

I'm using net user command in a batch script to find the last login time of a user : net user administrator | findstr /B /C:"Last logon" The result looks like this : Last logon 04/23/2020 9:02 AM I would like to display the date…
Cospuser
  • 41
  • 1
  • 5
0
votes
1 answer

Powershell - Net Use credentials not working

i want to automate net use through powershell to bind a lot of share drives. first i fetch the credentials via Get-Credentials, then i want to use the credentials later. $cred = Get-Credentials -Message "Enter credentials" net use K:…
Flying Thunder
  • 890
  • 2
  • 11
  • 37
0
votes
1 answer

Converting DOS Batch file commands to VBA Function

I have created and am using the following function to map and shorten the path-length of a network drive using SUBST command to work with my tool that implements ADO. Function MapBasePathToDrive(FullDirectory As String, strDrive As String,…
sifar
  • 1,086
  • 1
  • 17
  • 43
0
votes
2 answers

Accessing file on network with user outside of the domain

I need to access a file from a network drive with a user who may not be in the domain. My current code is: private async Task GetUxVersionsFromServer() { string path = @$"\\{IpAddress}\...\...\..."; if(!await GetFiles(path)) …
SteveZ
  • 175
  • 10
0
votes
0 answers

not able to access a network drive using credentials in php

I am working on a php code as shown below in which I am making a connection to network drive using credentials. Php code: $user = 'mickeymouse'; $password = 'helloworld'; exec('net use "\\\INVEST-ST-001\Video_Remap\podcast\" /user:"'.$user.'"…
flash
  • 1,455
  • 11
  • 61
  • 132
0
votes
1 answer

How does one assign a drive letter using an array variable in a batch file?

I'm trying to create a login script that uses an array to loop through a set of letters. I've coupled this with adding a counter to move through the array. When using the net use command, I get an error saying the network name can not be found. The…
Nick War
  • 3
  • 1
0
votes
2 answers

How to pipe output of net use command to file

I am just getting a blank file with the following command: net use \\computername password /user:username > log.txt How can I get this to work?
tim.tub
  • 69
  • 2
  • 7
0
votes
2 answers

find net use with batch

Hi just wanted to know if its possible to create a txt file listing all net use path
melvern
  • 33
  • 4
0
votes
1 answer

Exporting Net Use results in PowerShell

I have a log off script that saves mapped network shares to a txt file: #File path for save $TxtPath = "C:\temp\" + "$env:UserName" + ".txt" #Clear existing entries in file Clear-Content -Path $TxtPath #Return drive letters $DriveList =…
1 2 3
8 9