Search found 23 matches

by sourbread
10 May 2013 13:28
Forum: DOS Batch Forum
Topic: Run one bat from another bat using elevated privileges.
Replies: 1
Views: 2567

Re: Run one bat from another bat using elevated privileges.

Got it :)

Code: Select all

@echo off &cls
SET localname=%COMPUTERNAME%
RUNAS /profile /USER:nscorp\g07bc "CMD /c \"C:\Users\g07bc\Desktop\New Folder\ScriptB.bat""
pause
by sourbread
10 May 2013 13:02
Forum: DOS Batch Forum
Topic: Run one bat from another bat using elevated privileges.
Replies: 1
Views: 2567

Run one bat from another bat using elevated privileges.

This might be simple, but I just can't seem to find anything specifically on how to run the command the way I need it. Here is my dilemma.. Call it: Script A Script B Script A runs without administrative privileges.. I need Script A to automatically kickoff Script B using admin privileges. This is w...
by sourbread
26 Mar 2013 07:05
Forum: DOS Batch Forum
Topic: Stop/start remote services.
Replies: 1
Views: 2452

Re: Stop/start remote services.

You might try this and see if it works... :sql for /f %%a in (C:\Final\Module\DBserver.txt) do sc \\%%a start "SQL" >> C:\Final\Logs\logs.txt if %errorlevel% == 0 ( for /F "skip=1 tokens=*" %%a in ('wmic computersystem get name') do if not defined model set computername=%%b echo ...
by sourbread
26 Mar 2013 06:48
Forum: DOS Batch Forum
Topic: Copying file to EVERY profile on a machine.
Replies: 3
Views: 3145

Re: Copying file to EVERY profile on a machine.

Yeah, I'm building the logic in the script to decipher the OS and copy the path accordingly. Looks like the tokens and a few syntax errors were my problem, thanks Foxi! That took care of it all for me!
by sourbread
25 Mar 2013 12:29
Forum: DOS Batch Forum
Topic: Copying file to EVERY profile on a machine.
Replies: 3
Views: 3145

Copying file to EVERY profile on a machine.

I think I'm really close but I got stuck and figured I would ask you guys... I have to copy an updated file to every profile on a machine and every future profile getting created. for /f "tokens=1,*" %%a in ('dir %systemdrive%\Users' /ad /b) do @xcopy /d /y source "c$\Users\%a\AppData...
by sourbread
27 Sep 2012 11:58
Forum: DOS Batch Forum
Topic: Capturing WMIC output as a Variable
Replies: 11
Views: 54341

Re: Capturing WMIC output as a Variable

Oh okay great! Just so I know, what does the skip=1 do?
by sourbread
27 Sep 2012 09:37
Forum: DOS Batch Forum
Topic: Capturing WMIC output as a Variable
Replies: 11
Views: 54341

Capturing WMIC output as a Variable

This one should be pretty simple, I'm assuming, but I can't figure it out. Want I need to do is write a script that will queue WMIC to retrieve both the Model# and Serial# of the machine and display it in a pretty neat fashion (in a nutshell, I plan on doing much more with it later) So far @echo off...
by sourbread
22 Aug 2012 07:31
Forum: DOS Batch Forum
Topic: My thank you
Replies: 1
Views: 2158

My thank you

Thanks to everyone who has been helping me recently! I had a few minutes to kill yesterday, so I bequeath you.... nyan cat :begin @echo off Title Nyan color 0D cls echo "+ o + o + o + o " echo " + o + + + o + +" echo "o + o + " echo " o + + + o + + + " echo &q...
by sourbread
15 Aug 2012 05:43
Forum: DOS Batch Forum
Topic: Registry Query not working correctly :-/
Replies: 21
Views: 13254

Re: Registry Query not working correctly :-/

Yeah, looks like my problem is with the errorhandling of rcmd. Essentially, what I did was use psexec to copy over the script and launch it that way, and the if argument is working as expected.

Thanks for the tip on the RCMD!
by sourbread
14 Aug 2012 12:21
Forum: DOS Batch Forum
Topic: Registry Query not working correctly :-/
Replies: 21
Views: 13254

Re: Registry Query not working correctly :-/

ok try this remove the 2>nul at the begining and add it at the end like this rcmd \\%enduser% reg query "hkcr\mime\database\content type\image/tiff" /v CLSID >nul &&( i don't get the 2>nul thing but if you don't want output add the nul at the end I think Ed showed him that in anot...
by sourbread
14 Aug 2012 11:25
Forum: DOS Batch Forum
Topic: Registry Query not working correctly :-/
Replies: 21
Views: 13254

Re: Registry Query not working correctly :-/

EDIT* RCMD has been added to my environment variables, so no need to specify the directory.
by sourbread
14 Aug 2012 11:24
Forum: DOS Batch Forum
Topic: Registry Query not working correctly :-/
Replies: 21
Views: 13254

Re: Registry Query not working correctly :-/

Right, basically, the only way that value is going to exist on our machines is if someone loads Quicktime on their machine, Quicktime will then add a CLSID reg value to that container. So, I didn't feel the need to specify a value since it will only exist under these conditions. When I run the rcmd ...
by sourbread
14 Aug 2012 11:07
Forum: DOS Batch Forum
Topic: Registry Query not working correctly :-/
Replies: 21
Views: 13254

Re: Registry Query not working correctly :-/

Still no dice.. I think I caught everywhere the suggested fix should be, but it's still jumping the gun. ~~~~~~~~~~~~~~~ set /p Enduser=Please enter end-user IP address or Machine Name: echo. echo =========================================================================== echo Checking to see if use...
by sourbread
14 Aug 2012 10:42
Forum: DOS Batch Forum
Topic: Registry Query not working correctly :-/
Replies: 21
Views: 13254

Re: Registry Query not working correctly :-/

Tried your fix and it's still behaving the same way :-/ Instantly jumps to %enduser% does not have an invalid Registry key.. even though I know the key itself exist. For the time being, I've simply removed the query process and forced the script to delete the entry regardless if it exists or not. No...
by sourbread
14 Aug 2012 09:13
Forum: DOS Batch Forum
Topic: Registry Query not working correctly :-/
Replies: 21
Views: 13254

Re: Registry Query not working correctly :-/

m Scroll down to Remote Command Service and download it. Basically, allows you to open up a "remote command prompt". The service has to be enabled on the other machine in order for it to work. This was the only way I could think of querying HKCR on a remote computer. Unless, there is anoth...